473,799 Members | 2,834 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Events in dynamic loaded assembly

Hi all,

I need a help with following problem. I need to create a menu from dynamic
loaded assembly on the main form of my application. The menu is created
succesfully, but the events of this menu, which are defined in the dynamic
loaded assembly, are not raised. How can I raise them?

Martin
---
Odchozí zpráva neobsahuje viry.
Zkontrolováno antivirovým systémem AVG (http://www.grisoft.cz).
Verze: 6.0.500 / Virová báze: 298 - datum vydání: 10.7.2003
Nov 13 '05 #1
1 2522
Martin,

I don't know the details of your application, but when you add a MenuItem to
your menu you can specify the event handler:

mnu.MenuItems.A dd("Item 1", New EventHandler(Ad dressOf mnu_Click))

If this doesn't work for you because you can get the address of the
procedure, you can use a common procedure for all the MenuItems events, then
using the Index property of the sender object you can at least find out what
was selected and take the appropriate actions.

For example:

' add items
mnu.MenuItems.A dd("Item 1", New EventHandler(Ad dressOf mnu_Click))
mnu.MenuItems.A dd("Item 2", New EventHandler(Ad dressOf mnu_Click))
mnu.MenuItems.A dd("Item 3", New EventHandler(Ad dressOf mnu_Click))

Protected Sub mnu_Click(ByVal sender As System.Object, ByVal e As
System.EventArg s)

Dim i As Integer

' get index
i = sender.Index

' do something with i
' ...

End Sub

HTH,

Gabriele

"Martin Falta" <ma**********@a tlas.cz> wrote in message
news:eL******** ******@TK2MSFTN GP12.phx.gbl...
Hi all,

I need a help with following problem. I need to create a menu from dynamic
loaded assembly on the main form of my application. The menu is created
succesfully, but the events of this menu, which are defined in the dynamic
loaded assembly, are not raised. How can I raise them?

Martin
---
Odchozí zpráva neobsahuje viry.
Zkontrolováno antivirovým systémem AVG (http://www.grisoft.cz).
Verze: 6.0.500 / Virová báze: 298 - datum vydání: 10.7.2003

Nov 13 '05 #2

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

Similar topics

9
4496
by: Ender | last post by:
I have an application that I would like third party developers to be able to create Plug-ins that will be dynamically loaded into our application to extend functionality. I have utilized the "Let Users Add Functionality to Your .NET Applications with Macros and Plug-Ins" article at MSDN for the dynamic loading of DLLs http://msdn.microsoft.com/msdnmag/issues/03/10/Plug-Ins/default.aspx
7
2445
by: cider123 | last post by:
I'm coding a project using the following article as reference: http://www.codeproject.com/csharp/DynamicPluginManager.asp In this type of project, plugins are loaded dynamically into a Plugin Manager. Your main application then hooks into the Plugin Manager. What I'm trying to figure out is how to impliment some form of raising
6
1228
by: JonS. | last post by:
Hi, I'm trying to create a Windows Forms portal application and need some help. What I currently have is a main application (.exe) containing an MDI form. The idea is that this main application loads forms from packages (i.e. DLLs containing one or more forms). The trick is that I'd like the form packages and forms loaded to be dynamic. Therefore the main application should be able to "discover" all the form packages, then allow those...
0
1167
by: Thomas W. Brown | last post by:
I have a C# library that dynamically creates a in-memory assembly and creates instances of the objects therein. From .NET applications, this works perfectly well. However, when I wrap this library in a COM wrapper, the instantiation of objects in this dynamic assembly fails. But if instead of dynamically compiling to an in-memory assembly I compile to disk and then use Assembly.LoadFrom(...) then things work again. It appears that...
4
2488
by: BrianS | last post by:
What is the best strategy for dynamic loading private assemblies in asp.net? I understand, and have confirmed, that any dll placed in the app's /bin dir will get loaded on startup. This is not desirable. I have a web service that, based on an input parameter, dynamically loads A, B or C library. I also understand that an separate AppDomain is needed to explicitly unload the Assembly. No other apps will use these assemblies. Do I need...
9
2308
by: Erik Frey | last post by:
Hi there, Just curious as to whether there's a clever way to see the events a control/object is firing off, perhaps written out to the debug console. It would be really handy to know which events a control is firing when I perform a certain action, and the order in which they are occurring. Thanks, Erik
6
2864
by: hlubocky | last post by:
I thought I had a good grasp of the problem related to dynamically creating controls, but it appears that as my application grew in complexity, the problem has resurfaced. As I understand it, in order for a dynamically created control to persist its state, it needs to be created and loaded into the page control hierarchy before the viewstate is loaded. The proposed solution, and that which I have been using, has been to create all of...
3
2218
by: lk | last post by:
I need some help regarding the mechanism to put in place to be able to dynamically update a remote object when the assembly where it is defined is modified, and this whitout having service interruption. Basically what I'm missing is how do we re-expose a remote object when assembly has changed, and this without any interruption to the callers. I have an application that exposes a remoting object (Well known service - Singleton or...
6
1759
by: Steve Hershoff | last post by:
Hi everyone, I've got a strange one here. There are two datagrids on my page, one nested within the other. I'll refer to them as the topmost and secondary datagrids. In the topmost datagrid's OnItemDataBound() method we check for the row in which it's appropriate to add the secondary datagrid. Exactly one row in the topmost grid will contain the secondary grid.
0
10485
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10252
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10231
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9073
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7565
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6805
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5463
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4141
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3759
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.