473,546 Members | 2,196 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 1407
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
2954
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
2924
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
1542
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
11257
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
8979
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
5250
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
7091
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
4193
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
2414
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
7507
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7435
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
7698
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. ...
0
7794
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...
1
5361
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
5080
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...
0
3492
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...
0
3472
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
747
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.