Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The problem is that once defined a COM interface is invariant. However COM has versioning so that a older interface can be setup as compatible with a new interface.</p> <p>What Visual BASIC does behind the scene is creates a NEW version of the com interface. Update the version number, adds the new methods and setup the needed info so that the new interface can be automatically used with the older interface.</p> <p>As it pointed out it looks like that Events are not done automatically. I used Visual Studio OLE/COM Object View and see the GUID change. </p> <p>A possible solution for a hybrid VB6/.NET is a bit of pain but keeps everything clear as to when you make changes. First you need need to use the OLE/COM Object view to get the IDL of the VB6 object. Then use the MIDL compiler to generate a typelib. From now on use the typelib as your reference. </p> <p>You will have to rename the interface as it will conflict with VB6 Name. The idea is that both the .NET and the VB6 will reference the typelib and implement the interfaces. Anytime you want to update the interface you change the IDL, recompile the typelib and implement the interface for both.</p> <p>Now if this sound a bit complex and leave going WFT!? I don't blame you. But in my own conversion project I found it useful in certain circumstances when the VB6 stuff still has ongoing development but you need to use it in .NET</p> <p>Now a simplifier solution could be to identify and separate the minimum needed for two components to interoperate. Say the events and some properites. Generate the IDL for that interface. Compile a typelib and use that as the reference. I have done that as well.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload