DLL Loading Problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • yxyworld@gmail.com

    DLL Loading Problem


    Hi, everyone. I have a problem with loading a dll in my program using
    LoadLibrary( LibaryName ). I'm only having that problem with a
    particular dll and never had that problem before. All of my other dlls
    are loadable and usable without problems. No significant changes have
    been made since the last successful use of the dll in my exe. Here's
    the general format of my dll and all my other dlls:

    #include <windows.h>
    #include <stdio.h>
    #include <math.h>
    #include <ctime>
    #include <cstdlib>

    /*
    (global constants and some global variables here)
    (function and class declarations here)
    (global variables here)
    */

    #ifdef __cplusplus
    extern "C" {
    #endif

    __declspec(dlle xport) void __cdecl SomeFunction1( /* arguments */ )
    {
    // bla bla bla
    }

    // the list continues...



    BOOL APIENTRY DllMain( HANDLE hModule,
    DWORD ul_reason_for_c all,
    LPVOID lpReserved
    )
    {
    return TRUE;
    }

    #ifdef __cplusplus
    }
    #endif

    To exclude the possibility that something was wrong in my main program
    that caused the error, I've made a simple console program that just
    loads the dll using LoadLibrary(), and as expected it returned NULL.
    I've tried using GetLastError after the dll failed to load but it just
    returned a 0. One of the possible causes that I can think of is my
    recent installation of SP3 for WinXP on my PC. Any suggestions and/or
    solutions are greatly appreciated.
  • Ian Collins

    #2
    Re: DLL Loading Problem

    yxyworld@gmail. com wrote:
    Hi, everyone. I have a problem with loading a dll in my program using
    LoadLibrary( LibaryName ).
    Try a windows group, this is an OS issue rather than a C++ one.
    --
    Ian Collins

    Comment

    • Paavo Helde

      #3
      Re: DLL Loading Problem

      yxyworld@gmail. com kirjutas:
      >
      Hi, everyone. I have a problem with loading a dll in my program using
      LoadLibrary( LibaryName ). I'm only having that problem with a
      particular dll and never had that problem before. All of my other dlls
      So, what problem it was? Probably off-topic here anyway, but as long as you
      have not told us, we can never know.

      (OT remark: for finding out some loading problems with Windows dll-s you
      can use Dependency Walker).

      Paavo

      Comment

      • Alex

        #4
        Re: DLL Loading Problem

        On 10ÔÂ23ÈÕ, ÉÏÎç4ʱ59·Ö, Paavo Helde <nob...@ebi.eew rote:
        yxywo...@gmail. com kirjutas:
        >
        >
        >
        Hi, everyone. I have a problem with loading a dll in my program using
        LoadLibrary( LibaryName ). I'm only having that problem with a
        particular dll and never had that problem before. All of my other dlls
        >
        So, what problem it was? Probably off-topic here anyway, but as long as you
        have not told us, we can never know.
        >
        (OT remark: for finding out some loading problems with Windows dll-s you
        can use Dependency Walker).
        >
        Paavo
        try following command
        /////////////////////
        dumpbin /exports "your dll name"
        /////////////////////
        and check the "ordinal" and "name"

        Comment

        Working...