CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 1999
    Location
    Upstate NY
    Posts
    6

    Beginner DLL question

    I am a intermediatly experienced C++ programmer, but have never worked with DLL's. When looking through a list of what is done when my computer boots up i saw that "rundll32.exe someDLLname, someFunctioncall" is executed. What i am wondering is where can i get a list of what the DLL's on my system contain and how can i use them, if i can at all.


  2. #2
    Join Date
    Jul 1999
    Location
    Moscow, Russia
    Posts
    667

    Re: Beginner DLL question

    Hi,
    The dll used by different applications are listed in the registry: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\SharedDLLs

    To call function from, dll try something like this:


    typedef UINT (CALLBACK* LPFNDLLFUNC1)(DWORD,UINT);
    .
    .
    .
    HINSTANCE hDLL; // Handle to DLL
    LPFNDLLFUNC1 lpfnDllFunc1; // Function pointer
    DWORD dwParam1;
    UINT uParam2, uReturnVal;
    hDLL = LoadLibrary("MyDLL");
    if (hDLL != NULL)
    {
    lpfnDllFunc1 = (LPFNDLLFUNC1)GetProcAddress(hDLL,
    "DLLFunc1");
    if (!lpfnDllFunc1)
    {
    // handle the error
    FreeLibrary(hDLL);
    return SOME_ERROR_CODE;
    }
    else
    {
    // call the function
    uReturnVal = lpfnDllFunc1(dwParam1, uParam2);
    }
    }




    Hope this helps,
    Oleg.


  3. #3
    Join Date
    Aug 1999
    Location
    Belgium
    Posts
    206

    Re: Beginner DLL question

    Some Practical tips:
    1. To get the exported function list of a dll.
    Right click on the DLL and look at the function export table in the DLL with QuickView

    2. To investigate what DLLs a program uses
    Surf to http://www.sysinternals.com/
    look for utilities and download the
    HandleEx utility.

    Best Regards,

    GBO.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured