473,587 Members | 2,320 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Dyn loaded files and owner status window

GTi
I have a main exe program that have a status window.
This exe program loads several dll files with Assembly.LoadFi le.
I want now this dll files to send my exe program messages so I can
display it
on my status window.
Is there any way I can call a class in my exe program from dll files?
The dll files don't know about the exe files and the exe program that
loaded may or may not have a status window.

Jan 5 '06 #1
6 1409
GTi wrote:
I have a main exe program that have a status window.
This exe program loads several dll files with Assembly.LoadFi le.
I want now this dll files to send my exe program messages so I can
display it
on my status window.
Is there any way I can call a class in my exe program from dll files?
The dll files don't know about the exe files and the exe program that
loaded may or may not have a status window.


I suggest you do this using interfaces defined in another DLL -
interfaces that both your program and your DLLs know about. The easiest
way would probably be to make the classes in your DLLs implement an
interface that had an event (or set of events), and then make your main
program subscribe to those events.

Jon

Jan 5 '06 #2
GTi
agree

Jan 5 '06 #3
Or quick and dirty....

Grab the handle of the window from its name (or pass it to the dll from the
exe) and then send nominated events to it. The event handler will call your
class.

Another method is to use sockets / named pipes if the calls are relatively
infrequent.
However, the 'right' solution is as Jon Skeet said, to create an
encapsulated message handler which can pass data from one object to another.
He suggests another dll with events - eminently logical. There are
alternatives including standalone exe/service talking to objects over sockets
/ named pipes / event handlers and (if you are masochistic) interrupts.
--
Paul
"Jon Skeet [C# MVP]" wrote:
GTi wrote:
I have a main exe program that have a status window.
This exe program loads several dll files with Assembly.LoadFi le.
I want now this dll files to send my exe program messages so I can
display it
on my status window.
Is there any way I can call a class in my exe program from dll files?
The dll files don't know about the exe files and the exe program that
loaded may or may not have a status window.


I suggest you do this using interfaces defined in another DLL -
interfaces that both your program and your DLLs know about. The easiest
way would probably be to make the classes in your DLLs implement an
interface that had an event (or set of events), and then make your main
program subscribe to those events.

Jon

Jan 5 '06 #4
GTi

Jon Skeet [C# MVP] wrote:
GTi wrote:
I have a main exe program that have a status window.
This exe program loads several dll files with Assembly.LoadFi le.
I want now this dll files to send my exe program messages so I can
display it
on my status window.
Is there any way I can call a class in my exe program from dll files?
The dll files don't know about the exe files and the exe program that
loaded may or may not have a status window.


I suggest you do this using interfaces defined in another DLL -
interfaces that both your program and your DLLs know about. The easiest
way would probably be to make the classes in your DLLs implement an
interface that had an event (or set of events), and then make your main
program subscribe to those events.

Jon


Do you have any good samples for this?

Jan 9 '06 #5
GTi

Jon Skeet [C# MVP] wrote:
GTi wrote:
I have a main exe program that have a status window.
This exe program loads several dll files with Assembly.LoadFi le.
I want now this dll files to send my exe program messages so I can
display it
on my status window.
Is there any way I can call a class in my exe program from dll files?
The dll files don't know about the exe files and the exe program that
loaded may or may not have a status window.


I suggest you do this using interfaces defined in another DLL -
interfaces that both your program and your DLLs know about. The easiest
way would probably be to make the classes in your DLLs implement an
interface that had an event (or set of events), and then make your main
program subscribe to those events.

Jon


Do you have any good samples for this?

Jan 9 '06 #6
GTi
Jon Skeet [C# MVP] wrote:
GTi wrote:
I have a main exe program that have a status window.
This exe program loads several dll files with Assembly.LoadFi le.
I want now this dll files to send my exe program messages so I can
display it
on my status window.
Is there any way I can call a class in my exe program from dll files?
The dll files don't know about the exe files and the exe program that
loaded may or may not have a status window.


I suggest you do this using interfaces defined in another DLL -
interfaces that both your program and your DLLs know about. The easiest
way would probably be to make the classes in your DLLs implement an
interface that had an event (or set of events), and then make your main
program subscribe to those events.

Jon


Do you have any samples of how this is done?

Jan 9 '06 #7

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

Similar topics

3
2956
by: dan glenn | last post by:
(PHP 4.3.4) THIS IS DRIVING ME NUTS! I have a website where I offer members their own bit of webspace to use and am coding a very simple 'filemanager' that allows a user to upload, delete, and edit text files (members, of course, will not have normal sign-on FTP access to the site - I just limit them to their own folder space). I'm hitting...
9
2928
by: Deepa | last post by:
I am trying to locate a file using the following code Set objXMLHTTP = Server.CreateObject("MSXML2.ServerXMLHTTP") strURL = "http://server/ApprovedAutoCAD/140-00007-01.dwg" objXMLHTTP.Open "GET", strURL, False, "login", "password" objXMLHTTP.Send strReturn = objXMLHTTP.status
1
1549
by: Sam Wuebben | last post by:
I've been trying to get the values of hidden fields from one of many forms on a page to load into a function. The test page is at: http;//www.mvldesign.com/test/item_pop.html The 'Add to Cart" image needs to send that forms data to the function seen in the head. Firebird's javascript Console states that "form has no properties"
12
11263
by: Mark Anderson | last post by:
Even with preloading roll-overs etc, the first set of images used on screen still have to load before they can be seen. So, I've been asked I can to show a text message 'loading...' while a number of images - 3 or 4 -load on an index page (personally I'd use smaller images, but....). Ideally I'm looking for a solution- if there is one that...
4
8986
by: Mark | last post by:
I am loading source files into several iframes, with each load happening after some user-generated event (like clicking a button). The loading works but I need to determine when the source file is FULLY loaded so I can do some calcs on its scroll height within the frame. If I check the scroll height right away (after fetching the file),...
2
5252
by: jgraham | last post by:
I have an application which configures the user interface (UI) at runtime, meaning, the images that make up the UI are loaded based on the current configuration when the application starts. The UI is populated with normal controls (buttons, lists, etc.) but some controls can load a bitmap to represent them. For instance, each button in the...
3
7094
by: Steve Teeples | last post by:
I have a simple application built with several DLLs that access XML files for information. My local setup works just fine. As defined in my Install folder, the files are copied to the "application folder" and the DLLs find them just fine. However, when I publish the same application to a local server for users to use the "click once"...
3
4197
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - I have window.status="Moomin"; why doesn't the statusbar change? ----------------------------------------------------------------------- When changing the status in an event (e.g. onmouseover) you should return true from the event. Also a number of browsers...
3
2416
by: marcofabian | last post by:
Hi: I've ben looking for a long time for an answer to mi problem. The thing is that I'm uin httprequest object to load files inside div tags. It works ok. My problem is that any javascript code defined inside my loaded fields simply can't bedetected, can0t be executed. I really need this to work because the I work with javascript code to measure...
0
7843
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8206
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. ...
1
7967
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...
0
8220
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6621
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...
1
5713
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...
0
3840
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...
1
2353
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
1
1452
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.