Thread: resources on linking to a dll

  1. #1
    Imperator of Darkness Luciferek's Avatar
    Join Date
    Jun 2008
    Location
    Detroit, MI
    Posts
    38

    resources on linking to a dll

    Hello,
    I am looking for materials (tutorials, lessons etc) on linking to a dll.
    With code examples & explanations. The code by itself doesn't help me much.

    What is HInstance and what does it do?

    Also, is there a way to find out what functions are inside a dll?

  2. #2
    Unregistered User Yarin's Avatar
    Join Date
    Jul 2007
    Posts
    2,158
    >> I am looking for materials (tutorials, lessons etc) on linking to a dll.
    >> With code examples & explanations. The code by itself doesn't help me much.
    http://www.tutorialized.com/tutorial...eginners/10913 ?

    >> What is HInstance and what does it do?
    HINSTANCE is basically a pointer to the DLL/Application, you can use it to dynamically load functions and more.

    >> Also, is there a way to find out what functions are inside a dll?
    http://www.nirsoft.net/utils/dll_export_viewer.html

  3. #3
    Imperator of Darkness Luciferek's Avatar
    Join Date
    Jun 2008
    Location
    Detroit, MI
    Posts
    38
    Thank you for those links, it is what I needed. And I have another question about Hinstance. From this tutorial
    An HINSTANCE is a Windows dat type that is a handle to an instance; in this case, that instance will be the DLL
    What kind of objects can be instances? Could .exe file be the instance? How about images, sound files?
    Also, how does LoadLibrary() find the DLL? is it looking in the same directory the program is in?

  4. #4
    3735928559
    Join Date
    Mar 2008
    Location
    RTP
    Posts
    838
    you pass LoadLibrary the path to the file.

    Code:
    HInstance h = LoadLibrary("path/to/file.dll");
    if(h)
    {
        assignFunctionPointers(h);
    }

  5. #5
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    All you really need to know that some things returns HINSTANCE and some functions takes HINSTANCE. Just keep the data type all the way, and you'll be fine.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. DLL resources with, image files?
    By parad0x13 in forum C++ Programming
    Replies: 0
    Last Post: 03-15-2009, 07:27 PM
  2. linking to my own DLL
    By yahn in forum C++ Programming
    Replies: 19
    Last Post: 10-13-2008, 07:59 PM
  3. Linking a DLL
    By ThorntonReed in forum C Programming
    Replies: 3
    Last Post: 04-29-2006, 10:00 AM
  4. AFX DLL with resources
    By LuckY in forum Windows Programming
    Replies: 0
    Last Post: 12-20-2003, 03:51 PM
  5. .lib vs .h vs .dll
    By Shadow12345 in forum C++ Programming
    Replies: 13
    Last Post: 01-01-2003, 05:29 AM