IMHO you don't need a dispatch interface for this. Importing the reference in this case makes the interface visible for the compiler. So I think this creates an early binding to the interface, but a late binding to the actual object. To prove the late binding you could try to pass the progid as a command-line argument, in which case the compiler has no chance to create an early binding.
Regards Csaba > -----Original Message----- > From: Marsh, Drew [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, August 27, 2002 5:42 PM > To: [EMAIL PROTECTED] > Subject: Re: [ADVANCED-DOTNET] Early or late binding? > > > Petter Nilsen, Technical Manager 8368 [mailto:[EMAIL PROTECTED]] > wrote: > > > In this test code, I want find various methods to call COM > > componentents using late binding. I've come across a method which I > > don't really know if it's using late or early binding. The > code works > > on that particular COM object, but I want to make sure it's > using late > > binding. Does anyone here know? I import the reference to get the > > IBisComServer interface type. > > You say you "import the reference"... I assume that means you > use tlbimp? How is the interface defined in the COM type > library? Is it defined as a pure dispatch interface or dual? > I believe the RCW interface will need to be marked with > InterfaceTypeAttribute with a value of > ComInterfaceType.IsIDispatch, but I'm not sure because > according to the docs that only seems to affect how the > managed interface would be exposed when exported to a COM > type library (tlbexp). > > HTH, > Drew > You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced DOTNET, or subscribe to other DevelopMentor lists at http://discuss.develop.com.