We just released the beta of version 7 of our VB6 based app. We have
documented how to write a VB.Net addin to extend our functionality and
it works just fine using the version 6 release.
One of our beta sites who has written and is selling a .Net addin for
the v6 tried to make his very same dll work with our beta 7, but it
failed with a "QueryInterface for interface xxx._yyy failed" error. I
can recreate the error here in the plant.
To complicate things, the beta site was sent a copy of the upgraded app
compiled without binary compatibility being set, and we thought that
might be the problem since the .Net DLL has a reference the original app
(for access to data class definitions used in the DLL). However,
recompiling the DLL with a reference to the correct executable (with
comptability set to the v6 app) and the problem still appears.
Any clues?
TIA!
Bo
Henk de Koning - 16 Dec 2004 10:01 GMT
Usually this is not caused by your application code, but by the RCW. Or
better by the proxy the RCW holds on to.
When this is the case, you probably have an issue with typelib registration.
For VB6 (COM) components remoting is exclusively done using the typelib
marshaler. For that to succeed it'll need to know your typelib. If the
typelib is not registered, only the standard COM interfaces will remote. For
anything else, you'll see an E_NOINTERFACE.
Also, if you need a proxy, you need remoting, which (barring COM+ and
contexts) means your .net counterpart has acquired an incompatible threading
model. You can check by looking at the ApartmentState for the managed thread.
That should say STA in your case. If it doesn't, it is probably time for a
STAThread attribute ...
> We just released the beta of version 7 of our VB6 based app. We have
> documented how to write a VB.Net addin to extend our functionality and
[quoted text clipped - 17 lines]
>
> Bo