>From what I am seeing you are using a predefined COM interface IBisComServer that you are referencing from an interopt dll or a typelib that you created from tblimp. In this case you are creating the object latebound in a sense BUT you are using the definition of the interface which will perform a single cast (QueryInterface) and then you will be early bound. If the typelib or interface GUIDs in your original dll change, you will need to recompile your .NET assembly with the new dll/tlb reference just like good old straight COM.
You are on the right track in creating the object with the Activator you just need to stick with the object data type (i.e. not a predetemined type so it's late-bound) and use something like the Type::InvokeMember() methods. I do have to admit though, I have only done late bound with .NET components and not COM so there could be more to it then jumping from the createinstance right into the Type::InvokeMember() methods. Chad On Tue, 27 Aug 2002 16:26:25 +0200, Petter Nilsen, Technical Manager 8368 <[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. > > Type rsoType; > IBisComServer salesObject; > > try > { > rsoType = >Type.GetTypeFromProgID("Sales_Srv.SalesServerComponent.1"); > > salesObject = (IBisComServer)Activator.CreateInstance(rsoType); > > if(salesObject != null) > { > int iBuild = salesObject.bcGetServerBuild(); > > Marshal.ReleaseComObject(salesObject); > } > } > catch(Exception) > { > > } > >-- >Petter Nilsen, [EMAIL PROTECTED] >Technical Manager, Internet Development, >Visma Software ASA > >You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced DOTNET, or >subscribe to other DevelopMentor lists at http://discuss.develop.com. You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced DOTNET, or subscribe to other DevelopMentor lists at http://discuss.develop.com.