Calling of Comwrapped Net code from the VB6 IDE fails with 'ActiveX Component can't create object' in Win7 but not in WinXP

StackOverflow https://stackoverflow.com/questions/17896331

質問

We are employing RegFree Com for over a year now succesfully to create hybrid VB6/VB.Net programs. As we now want to develop some components in Net 4.5 we have to start using the VB6 IDE from Win7, where we first developed from WinXP.

The problem is that the exact same RegFree Com configuration that works with the VB6 IDE from WinXP does not work from Win7.(installing the compiled executable works flawlessly). We get the general "ActiveX Component can't create object' error. I used Fuslogvw.exe and SxSTrace.exe, I scourged the Windows logs, but no error message that explains why the instantiation of the object fails surfaces.

So, what more can I do to find the cause of this problem?

役に立ちましたか?

解決

This problem was mentioned before on SO in 2010, the solution was then to run the VB6 IDE in WinXP SP2 compatibility mode (as administrator). This solution did not work for me. It seems that WinXP implemented RegFree Com differently. So registering with regasm using the /tlb directive is now necessary.

Bob warns against the practice of using manifests for the VB6.exe to test Com wrappers for Net assemblies. We have used this technique for over a year without any problems though.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top