473,325 Members | 2,774 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

The problem of com event and its registe

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.Interfa ceIsIDispatch)]
public interface Ievent
{
public event EventHandler finishevent;
void DoMethod();
}
[Guid("xxxx"),ClassInterface(ClassInterfaceType.Non e),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.
Nov 17 '05 #1
1 906
You should not use Regsvr32 ,use RegAsm instead
http://msdn.microsoft.com/library/de...lRegasmexe.asp
"Jet" <li******@126.com> wrote in message
news:uJ*************@TK2MSFTNGP15.phx.gbl...
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.Interfa ceIsIDispatch)]
public interface Ievent
{
public event EventHandler finishevent;
void DoMethod();
}
[Guid("xxxx"),ClassInterface(ClassInterfaceType.Non e),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.

Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Andy Read | last post by:
Hello all, I have the requirement to produce source code that produces an object hierarchy. Example: Root | Folder 1
18
by: Christopher W. Douglas | last post by:
I am writing a VB.NET application in Visual Studio 2003. I have written a method that handles several events, such as closing a form and changing the visible status of a form. I have some code...
8
by: Mark | last post by:
Hi, I'm looking for some ideas on how to build a very simple Event processing framework in my C++ app. Here is a quick background ... I'm building a multithreaded app in C++ (on Linux) that...
13
by: Charles Law | last post by:
Mr "yEaH rIgHt" posted the following link about a week ago in answer to my question about removing event handlers. > http://www.vbinfozine.com/t_bindevt.shtml Following on from that post, the...
12
by: Jack Russell | last post by:
My unstanding of all VB up to and including vb6 is that an event could not "interrupt" itself. For instance if you had a timer event containing a msgbox then you would only get one message. ...
41
by: JohnR | last post by:
In it's simplest form, assume that I have created a usercontrol, WSToolBarButton that contains a button. I would like to eventually create copies of WSToolBarButton dynamically at run time based...
9
by: jeff | last post by:
New VB user...developer... Situation...simplified... - I want to wrap a pre and post event around a system generated where the pre-event will always execute before the system event and the...
19
by: Daniela Roman | last post by:
Hello, I try to fire an event under a button click event and maybe anybody can give a clue please. I have let's say a WEB grid with PageIndexChanged event: private void...
5
by: jaysonnward | last post by:
Hello All: I've recently been recreating some 'dropdown menus' for a website I manage. I'm writing all my event handlers into my .js file. I've got the coding to work in Firefox, but the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.