串連 ActiveX控制項工程時斷言錯誤處理 oletypld.cpp line:32

來源:互聯網
上載者:User

建立的 ActiveX 控制項工程,就算什麼代碼都不寫進去,在串連時也會出現這樣的問題;忽略斷言錯誤繼續下去,在Debug下產生了 .ocx檔案,直接在運行對話方塊裡輸入: regsvr32 D:\ActiveX\debug\XXX.ocx (路徑對的)也會出現同樣的斷言錯誤,不能註冊;根據斷言提示的錯誤去尋找相關的錯誤 發現是紅色部分的斷言:
void CCmdTarget::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);
}

到網上尋找各種關於GetTypeLibCache();的資訊也找不到,查看MFC的源碼也找不到什麼說明,沒有辦法,果斷放棄看源碼!!

結果今天不小心在MSDN上看到一個和我同樣的例子:

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, 12:38 PMPorlem is solved

It is version of MFCO42D.DLL

原來:其實是
MFCO42D.DLL這個檔案的版本問題,出問題的機器裡的system32中的此檔案為98年的版本,覆蓋為04年的版本就沒有問題了。





聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.