我有一個(COM Interop基礎)ActiveX控件,我試圖使用免費註冊com。當控件加載控件無效(不響應事件,控制不完全呈現等)。使用註冊免費COM激活(基於COM互操作的)ActiveX控件com
經過大量搜索,我發現使用reg-free-com的COM對象使用miscStatus屬性來設置初始狀態以正確激活。我知道如何將它與一個與本機COM對象相對應的comClass一起使用。
1)對應於COM-interop對象的clrClass元素的等效項如下?
<comClass clsid="{qqqqqqqq-wwww-eeee-rrrr-00C0F0283628}"
tlbid="{xxxxxxxx-yyyy-zzzz-aaaa-0000F8754DA1}"
threadingModel="Both"
progid="SomeCompany.SomeOleControl"
description="Some ActiveX Control"
miscStatus="recomposeonresize,insideout,activatewhenvisible,nouiactivate" >
2)我使用的COM客戶端是Visual FoxPro。如果(1)不可行我可以在VFP中做什麼來激活不活動的ActiveX控件。 (我不介意VB或者C#的輸入太多,如果我可以用它來尋找等效的FoxPro)
目前我嘗試以下
this.AddObject('OleControl1', 'oleControl', 'SomeCompany.SomeOleControl')
this.OleControl1.AutoActivate = 3
this.OleControl1.Visible = .T.
this.OleControl1.SetFocus
但我的OleControl1得到傳遞的事件,如鼠標點擊之前集中子元素。所以我必須點擊兩次才能進行必要的操作,任何時候它都沒有焦點。我希望控件能夠像設置miscStatus值的「nouiactivate」一樣工作。
3)有沒有其他的方式來完成我想要做的事情?
Hans Passant,這裏是當前Assembly.dll.manifest的列表。評論中的格式使其無法閱讀。
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity name="Assembly"
version="1.0.0.0" type="win32" publicKeyToken="wwwwwwwwwwwwwwww"/>
<clrClass
name="SomeCompany.SomeOleControl"
clsid="{qqqqqqqq-wwww-eeee-rrrr-00C0F0283628}"
progid="SomeCompany.SomeOleControl"
threadingModel="Both"/>
<file name="Assembly.tlb">
<typelib
tlbid="{xxxxxxxx-yyyy-zzzz-aaaa-0000F8754DA1}"
version="1.0"
helpdir=""
flags="hasdiskimage"/>
</file>
</assembly>
我曾試過元素的miscstatus。它被忽略了。它與註冊Regasm正常工作。這就是我現在正在做的事情。 但是,這是我第一次使用清單文件。我更願意使用清單文件而不是代碼來解決問題。這樣,代碼可以在有或沒有註冊的情況下以任何方式工作。我很感激您在修復清單文件時可以給我的任何幫助。 我將添加另一個評論與assembly.dll.manifest的列表 –
embnut
2010-05-18 13:49:12