Please help - regsvr32 failed due to Invalid access to memory location
Hi There,
I am working on a MFC application with some Dlls. Development
environment: Visual Studio 6.0 / Sp6 on Windows XP/Sp2. I login the
system as an administrator.
When I was registering debug version of my dll using regsvr32, it
failed. Result of debugging points (using VS 6.0) to:
BOOL COleLinkingDoc::RegisterIfServerAttached(LPCTSTR lpszPathName,
BOOL bMessage)
The lpszPathName is my dll file name, which is empty; although I am
sure the path name has been sent to the regsvr32.
I tried to register the same dll file programmatically:
// Start of the code /////////
#ifdef _WIN32
// this call failed because file path is empty when it is passed
to
// OleLinkingDoc::RegisterIfServerAttached function even I send a
// const string! Note that if it is release version, it works fine
HINSTANCE hDLL = LoadLibrary("C:\\MyProject\\Debug\\MyLib.ocx");
if(NULL == hDLL)
{
// See Winerror.h for explaination of error code.
DWORD error = GetLastError();
TRACE1("LoadLibrary() Failed with: %i\n", error);
}
#endif
//
/////////End of code ////////
I'd try to run the 'regsvr32.exe' command in the DependencyWalker in
'Profile' mode. Error Info:
Library that is missing from the system:
MFC42LOC.DLL (this is a language related library. the warning can be
ignored)
LoadLibraryExW("C:\myProject\Debug\myLib.ocx"
, 0x00000000
, LOAD_WITH_ALTERED_SEARCH_PATH)
returned NULL. Error: Invalid access to memory location (998).
Could anyone tell me what causes the problem?
Thank you,
Jay229