The problem of com event and its registe

J

Jet

Hi all,
As some special need , I have to make a com component in c#,but I don't know
how to make a com object event, I had declared a event interface. Like this:
delegate void EventHandler(object sender,EventArgs e);
[Guid("xxxxx-xxxx"),
public interface Imethod:Ievent
{
[DispId(1)]
void GetList();
//Ievent method
[DispId(2)]
void OnFinish(object sender,EventArgs e);
[DispId(3)]
new void DoMethod();
}
[Guid("xxx"),InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
public interface Ievent
{
public event EventHandler finishevent;
void DoMethod();
}
[Guid("xxxx"),ClassInterface(ClassInterfaceType.None),ComSourceInterfaces(ty
peof(IComFileEvents))]
pbulic class a:Imethod
{
...
}
The first problem is how can I make the com object event in c#? Does my code
is right?

The second problem is I can complie it success,but when I run regsvr32.exe
to registe it, the system throw me "test.dll had loaded,but can't find the
entrypoint of test.dll.So registe fail!"
How can I solve it and make it can run in non- .net client such as vb client
or vc++ client.
 

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