Okay I'll try that. I just noticed, a few of the classes in question are
also MarshalByRefObjects, would that make any difference?

-----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.

Reply via email to