Mr. Nathan, thank you very much! There are basically 4 different classes being created in my code.. I have so far converted 2 of them to work with interfaces when dealing with com (and marshalled the non-vb data types correctly), and I now have it performing about 10% worse than it originally performed. I think if change the 2 other classes, I'll have my old vb objects performing about twice as fast as they used to!
Thanks Adam.. -----Original Message----- From: Adam Nathan [mailto:[EMAIL PROTECTED]] Sent: Friday, April 12, 2002 2:06 PM To: [EMAIL PROTECTED] Subject: Re: [DOTNET] VB6 -> .NET interop slow? > Now, I initially assumed it was that I hadn't generated a type library and > "early bound" my Object variables to the appropriate types. So I exported > the typelib, no more CreateObject, etc, and it's still slow (no visible > improvement). Because .NET classes only expose their members via IDispatch by default, this step alone shouldn't cause visible improvement. But, if you: a) Define a .NET interface for your interop class to implement b) Mark your interop class with [ClassInterface(ClassInterfaceType.None)] to make the implemented interface the default one c) Export a type library and make use of it from VB6 then you should see much better performance. Defining your own "real interface" is much better than using ClassInterfaceType.AutoDual, and you'll only break your VB6 clients if you make changes to that interface. You can read messages from the DOTNET archive, unsubscribe from DOTNET, or subscribe to other DevelopMentor lists at http://discuss.develop.com.