Thread: Help : creating DLL in C

  1. #1
    Registered User
    Join Date
    Dec 2011
    Posts
    3

    Help : creating DLL in C

    Hello,

    I've been looking all over the internet and haven't found even one single guide on how to make a DLL in C language, properly.
    All there is is C# and C++. Alas..

    Anyway, I'm building a simulator which will have 7-Seg displays, switchs, leds and etc. The simulator is written in VB and is already ready, didn't take much time. Now all I have to do is create a DLL which will be responsible for "linking" the simulator and the program(in C) a user will write.
    For example, if the user has written that he wants the number '4' to appear on the 7-Seg , then the number '4' will appear on the 7-seg display in the simulator.
    I think I'll probably need the DLL to have 4 or 5 functions. Set/Get for receiving/sending data from the simulator,In/Out for doing the same ,only with the program written by the user , and probably a DB(database) function that will have a static array, it will receive , for example, the numbers of the leds the user wants to light and this array will be sent to the Get or Set function that will do that.

    Now, I've tried creating a DLL based on some C++ tutorials but all my attempts failed. There was one time I thought I made it, but then when I tried to use it in VB I got an error.

    I then tried running Regsvr32 , and that's what I got :
    http://img33.imageshack.us/img33/732/asdasdasdbe.jpg
    A help will be much appreciated.

    Thank you.
    Last edited by Somnium; 12-09-2011 at 12:04 PM.

  2. #2
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Couldn't have looked very hard...

    CLICK

  3. #3
    Registered User
    Join Date
    Dec 2011
    Posts
    3
    It's not really helpful... It doesn't describe how to create a DLL, at least in C. There's some description of creating DLL in C++ , but that I have already found.

    Can you please show me how to write even the simplest DLL in C, printing "hello". Should I open some header file, if so what to write there? and the same question about the source file.

    thank you.

  4. #4
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by Somnium View Post
    It's not really helpful... It doesn't describe how to create a DLL, at least in C. There's some description of creating DLL in C++ , but that I have already found.

    Can you please show me how to write even the simplest DLL in C, printing "hello". Should I open some header file, if so what to write there? and the same question about the source file.

    thank you.
    Did you read it past the first page? There are about 2 dozen pages there giving you a complete and thorough explaination of what's needed.

    The only information that don't --can't-- give you is the compiler/linker flags for your specific setup and those will be detailed in your compiler's documentation.

  5. #5
    Registered User
    Join Date
    Dec 2011
    Posts
    3
    you mean this?
    Creating a Simple Dynamic-Link Library

    it's mixed , C and C++ and I don't know what parts exactly are C++ so that I could just erase it.
    There's also a lot of code there , handle ,for example... is it necessary? isn't there any way around that?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Creating DLL
    By gavio in forum Windows Programming
    Replies: 11
    Last Post: 12-11-2006, 11:17 AM
  2. Creating a lib (HELP)
    By Captain_Bunny in forum Linux Programming
    Replies: 2
    Last Post: 12-21-2005, 04:12 AM
  3. Creating a gui?
    By Kaho in forum C Programming
    Replies: 12
    Last Post: 08-20-2005, 08:56 PM
  4. Creating a LIB
    By X PaYnE X in forum Windows Programming
    Replies: 9
    Last Post: 01-08-2004, 12:10 PM
  5. creating gui in C
    By pmacne in forum C++ Programming
    Replies: 5
    Last Post: 02-14-2003, 07:44 PM