Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

win32 app and MFC¨s DLL

Status
Not open for further replies.

TeSSeO

Programmer
Feb 18, 2002
14
0
0
ES
Hi there,
I´m programming a win32 app and I have to use an Object that uses MFC. I have created the object in a DLL and I call that DLL from my win32app with LoadLibrary and GetProcAddress. When I try to create the object in the DLL, I gets an error message saying something like that:

'Instruction in "0x6c2a1694" refers to memory "0x0000000". The memory can not be read '

...and the programm stops.

Any idea what can I do? Thnks...
 
It may be, if:
1. LoadLibrary() and/or GetProcAddress() returns NULL.
2. You have a NULL pointer(s) in Your Object. To find it out, create a MFC-Based Application with Your Object and debug all Functions You call from the DLL.
3. Some DLL - Functions try to alloc/dealloc memory (with new/delete, HeapAlloc()/HeapFree(), malloc()/free(), VirtualAlloc(), GlobalAlloc() etc.) in space of another File - it works not allways.
4. You have wrong connections between App and DLL (for example, the same global Variables or Functions - if You use one Project Workspace for both features, compiler/linker give no warnings ).
5. ...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top