Loading dll with LoadLibrary

This is a discussion on Loading dll with LoadLibrary within the Windows Programming forums, part of the Platform Specific Boards category; Hi, I've been trying to load a dll using LoadLibrary. But the call to load that library returned a NULL. ...

  1. #1
    In the Land of Diddly-Doo g4j31a5's Avatar
    Join Date
    Jul 2006
    Posts
    476

    Loading dll with LoadLibrary

    Hi, I've been trying to load a dll using LoadLibrary. But the call to load that library returned a NULL. And when I run GetLastError, it showed me this error message:

    ‎"This application has failed to start because the application
    configuration is incorrect. Reinstalling the application may fix this
    problem."
    I've installed the vcredist and copied the whole content of Microsoft.VC80.CRT to the binary folder since I thought maybe it was because of the SxS issue. I guess I was wrong.

    BTW, does LoadLibrary always search for DLLMain? The one I tried to load doesn't have DLLMain.

    What went wrong here? Thanks in advance.
    ERROR: Brain not found. Please insert a new brain!

    “Do nothing which is of no use.” - Miyamoto Musashi.

  2. #2
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,670
    Quote Originally Posted by g4j31a5 View Post
    Hi, I've been trying to load a dll using LoadLibrary. But the call to load that library returned a NULL. And when I run GetLastError, it showed me this error message:



    I've installed the vcredist and copied the whole content of Microsoft.VC80.CRT to the binary folder since I thought maybe it was because of the SxS issue. I guess I was wrong.

    BTW, does LoadLibrary always search for DLLMain? The one I tried to load doesn't have DLLMain.

    What went wrong here? Thanks in advance.
    All DLL's must have an entry point, although it needn't be named "DLLMain" (from the loader's perspective, at least - most compiler vendors do use the "DLLMain" identifier, by default, and overriding that generally requires the use of special switches).



    ITSA
    Socket Library!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Losing reference between dlls
    By g4j31a5 in forum Windows Programming
    Replies: 7
    Last Post: 05-19-2010, 02:28 AM
  2. Dll Loading Twice?
    By pobri19 in forum Windows Programming
    Replies: 2
    Last Post: 11-25-2009, 10:26 AM
  3. Loading a DLL that is not in the same directory as the executable
    By starcatcher in forum Windows Programming
    Replies: 10
    Last Post: 12-13-2008, 06:05 AM
  4. Replies: 8
    Last Post: 12-01-2008, 09:09 AM
  5. Loading a DLL at runtime
    By filler_bunny in forum Windows Programming
    Replies: 9
    Last Post: 02-23-2003, 07:03 AM

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