I am working with the old OCX libraries. Development environment: Windows XP/Sp2 + Visual Studio 6.0 / Sp6.
When I was registering for the debug version of my OCX library using regsvr32, it failed and result of debug points to:
BOOL COleLinkingDoc::RegisterIfServerAttached(LPCTSTR lpszPathName, BOOL bMessage)
The lpszPathName that is my OCX file name is empty; although I am sure the path name has been sent to the regsvr32.
I tried to register the same OCX file in my code:
// Start of the code /////////
// this call failed because file path is empty when it is passed to COleLinkingDoc::RegisterIfServerAttached function even I send a const string!
// Note that if it is release version, it works fine
HINSTANCE hDLL = LoadLibrary("C:\\MyOcx\\Debug\\MyLib.ocx");
if(NULL == hDLL)
// See Winerror.h for explaination of error code.
DWORD error = GetLastError();
TRACE1("LoadLibrary() Failed with: %i\n", error);
/////////End of code ////////
Could anybody here tell me why the problem occurs and how to get rid of it?