Even if no code is written into the newly created ActiveX Control Project, this problem occurs during connection. Ignore the asserted error and continue. enter regsvr32 D: \ ActiveX \ debug \ XXX in the running dialog box. ocx (path-to-path) will also see the same assertion error and cannot be registered. Based on the assertion error, find the relevant error and find the assertion in Red:
Void c0000target: EnableTypeLib ()
{
AfxLockGlobals (CRIT_TYPELIBCACHE );
CTypeLibCache * pTypeLibCache = GetTypeLibCache ();
ASSERT (pTypeLibCache! = NULL); // must override GetTypeLibCache
If (pTypeLibCache! = NULL)
PTypeLibCache-> Lock (); // will be unlocked in OnFinalRelease
AfxUnlockGlobals (CRIT_TYPELIBCACHE );
}
I couldn't find any information about GetTypeLibCache (); and I couldn't find any instructions on the source code of MFC. I couldn't find a solution. I just gave up looking at the source code !!
As a result, I accidentally saw the same example on MSDN today:
When
I try register control
Regsvr32 CliControl. ocx
On some computersIhave "Debug Assertion Failed" in oletyplb. dll line 32
NOTE: On some computers... (WIN 2000 and XP)
According to oletyplb. cpp lines 31-32 are
CTypeLibCache * pTypeLibCache = GetTypeLibCache ();
ASSERT (pTypeLibCache! = NULL); // must override GetTypeLibCache
But I have no problems on other computers.
I check DLLs (that is listed in Dependency Walker)-all them are in System32 directory.
Has anybody some ideas?
--------------------------------------------------------------------------------
Jumpow04-07-2005, PMPorlem is solved
It is version of MFCO42D. DLL
Originally: actually
The version of the MFCO42D. DLL file is incorrect. The file in system32 on the faulty machine is 98 years old, and the version is 04 years old.