473,398 Members | 2,188 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,398 software developers and data experts.

DLL Event

Hello!

I worked with vb6 and now it I'm working with VS C# 2005
(I'm an c#- beginner)

I have a main progamm which search for Dlls in a folder.
I include all dlls and thats no problem: i can call the functions with
arguments.

Now my problem is that the dll has an event "ErrorEvent(string errmsg)"
which should be raised and the mainprogramm should notify and take
care of this message (Show Messagebox for examle).

I tried with delegation but it didn't work.

Can anyone help me.

Thank you!

Nov 13 '06 #1
3 1507
Could you post some code as to what you are trying to do. Also, are you
using visual studio or comand line compiling?

Ciaran O'Donnell

"MWismet" wrote:
Hello!

I worked with vb6 and now it I'm working with VS C# 2005
(I'm an c#- beginner)

I have a main progamm which search for Dlls in a folder.
I include all dlls and thats no problem: i can call the functions with
arguments.

Now my problem is that the dll has an event "ErrorEvent(string errmsg)"
which should be raised and the mainprogramm should notify and take
care of this message (Show Messagebox for examle).

I tried with delegation but it didn't work.

Can anyone help me.

Thank you!

Nov 13 '06 #2
Hello Ciaran,

thank you for answering!

the following code is okay:
**********************************************
AssemblyName name = new AssemblyName();

name.CodeBase = str_DLL_FILE;
Assembly assembly = AppDomain.CurrentDomain.Load(name);

object remoteObject ;
remoteObject= assembly.CreateInstance(str_NAME_SPACE, false, myFlags,
null, args, null,null);
Type remoteType = assembly.GetType(str_NAME_SPACE);

//call the methode Get_Dll_Versions_Number
//returns a string with versionnumber of dll
MethodInfo methode = remoteType.GetMethod("Get_Dll_Versions_Number");
object result = methode.Invoke(remoteObject, null);
string v_num = result.ToString();
**********************************************

the dll has an event with the name "Dll_Error_Handler" with a string
containing the errorstring.

how can i get this event??

in the moment i try to solve the problem with an
abstract class, because the interface is known
and dll and mainprg are including this class.

I'm using visual studio 2005

thank you

Michael

Ciaran O''Donnell schrieb:
Could you post some code as to what you are trying to do. Also, are you
using visual studio or comand line compiling?

Ciaran O'Donnell

"MWismet" wrote:
Hello!

I worked with vb6 and now it I'm working with VS C# 2005
(I'm an c#- beginner)

I have a main progamm which search for Dlls in a folder.
I include all dlls and thats no problem: i can call the functions with
arguments.

Now my problem is that the dll has an event "ErrorEvent(string errmsg)"
which should be raised and the mainprogramm should notify and take
care of this message (Show Messagebox for examle).

I tried with delegation but it didn't work.

Can anyone help me.

Thank you!
Nov 14 '06 #3
Hello Ciaran,

thank you!

i managed it with the abstract class!

now it works and it's very easy to implement!

By Michael

Nov 16 '06 #4

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...
9
by: VK | last post by:
My original idea of two trains, however pictural it was, appeared to be wrong. The truth seems to be even more chaotic. IE implements its standard down-up model: any mouse event goes from the...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.