Implementing VB WithEvents in C#

B

booksnore

Hi,
I'm trying to use a COM component in a C#.NET project. The sample VB
code of the COM component declares it as so,

Public WithEvents APC As ENTAPCDLL

I've made a reference to the com object in C# project, I want to set the
value of
an object called InputData which is a member of ENTAPCDLL - here's an
extract
from the object browser

public abstract new object InputData [ get, set ]
Member of ENTAPC._ENTAPCDLL

How can I set the value of InputData in C#?
If I create an instance of the ENTAPCDLL class and then do something
like

ENTAPCObject.InputData = new object();

I get " Property, indexer, or event 'InputData' is not supported by the
language; try directly calling accessor methods
'ENTAPC.ENTAPCDLLClass.get_InputData()' or
'ENTAPC.ENTAPCDLLClass.set_InputData(ref object)'"

Any help appreciated.

Joe
 
G

Guest

Try calling:

object 0 =new object();
ENTAPCObject.set_InputData(ref o)'


this is one of those little quirks of COM Interop - generated wrappers in C#.

Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top