tags:

views:

219

answers:

1

I am trying to access a COM dll(eObjectBroker) from my C# application. Here are things I have done.

  1. run tlbimport with eObjectBroker.dll to get the assembly. I get two assemblies, as COMSVCLIB is referenced from eObjectBroker. So I have eObjectType.dll and COMSCVLIB.dll

  2. I add reference to these two assemblies in my .Net c# project. I also add reference to adodb.dll as a function call I make returns a Recordset type object.

  3. I create the instance for a class in eObjectType and call one of its function. On this call I get the error 'Object variable or with Block variable not set'

What have I missed out? Is this the right method to access the COM dll?

+2  A: 

Using VS2005 and later all you have to do is add a reference to a registered (with regsvr32.exe) COM dll, create a new instance and call it's methods. I believe you would have to instatiate the main class of the COM object though and access the other parts through that interface.

Farawin