Thread: Error calling DLL from protected location

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    May 2011
    Location
    Around 8.3 light-minutes from the Sun
    Posts
    1,949
    When you ported the program over to Windows 7 did you recompile everything to make it 64bit? There was a bug floating around MSDN wrt Windows 7 and calling 32 bit dlls. The bug resulted in an error however, I think it was "invalid image file" or something like that.
    Quote Originally Posted by anduril462 View Post
    Now, please, for the love of all things good and holy, think about what you're doing! Don't just run around willy-nilly, coding like a drunk two-year-old....
    Quote Originally Posted by quzah View Post
    ..... Just don't be surprised when I say you aren't using standard C anymore, and as such,are off in your own little universe that I will completely disregard.
    Warning: Some or all of my posted code may be non-standard and as such should not be used and in no case looked at.

  2. #2
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Location
    Hannover, Germany
    Posts
    3,130
    Do you get any error message or crashed? How is the dll linked to your program? Do you load it dynamically, if so, was it found and was the entry point found?

    Did you recompile the executable with a newer compiler when changing systems? The STL and most other libraries can't be mixed, all executables and libraries need to be compiled by the same compiler (including version) to function.
    hth
    -nv

    She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."

    When in doubt, read the FAQ.
    Then ask a smart question.

  3. #3
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by nvoigt View Post
    Do you get any error message or crashed? How is the dll linked to your program? Do you load it dynamically, if so, was it found and was the entry point found?

    Did you recompile the executable with a newer compiler when changing systems? The STL and most other libraries can't be mixed, all executables and libraries need to be compiled by the same compiler (including version) to function.
    So much for C++'s claims of portability....

  4. #4
    'Allo, 'Allo, Allo
    Join Date
    Apr 2008
    Posts
    639
    What's the error returned by GetLastError when you fail to LoadLibrary or GetProcAddress? If you don't have control of the loading code, grab Process Monitor to see what it's trying to load and the error, or grab DebugView and wade through the loader's debug spew.

  5. #5
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    Sounds to me like there's a bug in the app or the DLL. Thus explaining both "it changes when moving to another platform" and "at least once, it magically worked." I seriously doubt this has anything to do with DLLs, loading of DLLs, administrator permissions, or OS version. Just a bug somewhere.
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. error C2248: can not access protected member
    By r0flc0pter in forum C++ Programming
    Replies: 3
    Last Post: 08-19-2009, 10:34 AM
  2. Replies: 1
    Last Post: 08-13-2008, 02:51 AM
  3. calling functions and error messages
    By l2u in forum C++ Programming
    Replies: 9
    Last Post: 07-27-2008, 01:06 PM
  4. error in calling a function
    By arian in forum C++ Programming
    Replies: 3
    Last Post: 12-24-2003, 02:42 AM
  5. error calling function
    By simhap in forum C++ Programming
    Replies: 3
    Last Post: 11-29-2001, 07:58 PM