0

I am working with a series of DLLs that are loaded as individual CView classes in a MFC application using LoadLibrary from WinBase.h.

Building for release works and all the various DLLs load. However, when I do a debug build with Visual Studio 2010, one (and only one) of the DLLs fails to load. All the DLLs are similarly designed. Using the debugger, I can see that LoadLibrary is getting error 998 (ERROR_NOACCESS, Invalid access to memory location.). I turned on break at access exception and the bad access appears to occur within the strcmp assembly at the instruction cmp al, [ecx] (ecx is 6D655277 at this point).

However, I am not sure how to further track down this bug (and Visual Studio tends to crash whenever I break at the access violation, making it even harder).

Any suggestions or past experiences are much welcome.

A.E. Drew
  • 2,097
  • 1
  • 16
  • 24
  • 2
    Look at the call stack and move up to the first function in it that belongs to your code. – Matteo Italia Jun 28 '13 at 17:24
  • I doubt this will be helpful, but in case this triggers a thought, the value in `ecx` being used as a pointer looks like it might be part of an ASCII string: "wRem" (maybe part of the DLL name?). Definitely Matteo's suggestion should be your next step. – Michael Burr Jun 28 '13 at 17:40
  • @MatteoItalia This helped. I found that some of my code was being called. Added the source to my Solution and ran in debug to further diagnose but simply adding it to my solution seems to have fixed the problem. No idea why, but it works now. – A.E. Drew Jun 28 '13 at 18:39

0 Answers0