resources on linking to a dll

This is a discussion on resources on linking to a dll within the C++ Programming forums, part of the General Programming Boards category; Hello, I am looking for materials (tutorials, lessons etc) on linking to a dll. With code examples & explanations. The ...

  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
    1,633
    >> 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
    A class that doesn't overload all operators just isn't finished yet. -- SmugCeePlusPlusWeenie
    A year spent in artificial intelligence is enough to make one believe in God. -- Alan J. Perlis

  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
    839
    you pass LoadLibrary the path to the file.

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

  5. #5
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,635
    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, 02:51 PM
  5. .lib vs .h vs .dll
    By Shadow12345 in forum C++ Programming
    Replies: 13
    Last Post: 01-01-2003, 04:29 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21