Thread: DLL Question

  1. #1
    Registered User
    Join Date
    Sep 2002
    Posts
    52

    DLL Question

    Hey guys,

    I have a question about using DLL's. On Linux I've used modules (.so files), dlopen() to load them, dlclose() to close them and dlsym() to call a function from each module.

    I recently looked at a windows program and thought I would try my luck doing this on Windows, so I thought about using a DLL as there are not dl*() functions for modules or none that I've found.

    My question is would I have to load the entire DLL into memory or can I simply have the DLL there call the proc each time I needed it, and where abouts would be a good start to look? I've done some basic searches on msdn and thought I would ask for a little more of a nudge.

    Basically, I have the core program which basically does parsing and runs the program and I want to have an easily updatable option, so I thought I could have a "module" for each main feature, am I heading in the right direction or should I just give up and keep researching windows programming before I look into this area?

    Cheers,
    - Daniel Wallace

  2. #2
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    What language (C or C++ or MFC) and what IDE (compiler) do you use?

    DLLs can be statically (at build time) or dynamically (at run time) linked.

    Dynamic;
    Look at LoadLibrary() and GetProcAddress() and FreeLibrary()

    Static;
    Use linker in IDE to add DLLs .lib file or look at the #import directive.
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

  3. #3
    Registered User
    Join Date
    Sep 2002
    Posts
    52

    Smile

    Well, me coming from a Linux background, I'm more inclined to look at Static from what you've suggested, I found something on MSDN about delay loading DLL's and such just after I posted the thread on here which looked good. I think dynamic is the way to go from what I was reading, lets play and see what happens, thanks for that
    - Daniel Wallace

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. non-MFC DLL with MFC app question.
    By Kempelen in forum Windows Programming
    Replies: 10
    Last Post: 08-20-2008, 07:11 AM
  2. Dll Injection Question
    By zenox in forum C Programming
    Replies: 13
    Last Post: 03-15-2008, 10:54 AM
  3. dll and classes question
    By Rune Hunter in forum C++ Programming
    Replies: 2
    Last Post: 12-17-2005, 09:26 PM
  4. C++ .NET - "inconsistent dll linkage" - What's that?
    By BrianK in forum Windows Programming
    Replies: 2
    Last Post: 03-16-2004, 10:16 AM
  5. Calling a VB DLL w/ forms from C++ DLL
    By UW_COOP in forum C++ Programming
    Replies: 8
    Last Post: 06-30-2003, 08:04 AM