04-27-2010 04:49 AM
Hi again,
I have been tasked with trying to separate an application into a modular form, basically I will have a main application which will be a generic GUI which must be associated with a DLL that contains test sequences. Currently these test sequences make calls to the various panel controls to display the test information, this currently works great. The problem that I am having is trying to understand code that is compiled to create a DLL is made aware of, what is essentially, global constants that are defined in my main application.
The purpose of this structure is that we will have a generic GUI for multiple products tests, with each DLL representing a different products test sequence, each DLL will be built using the same framework with the generic GUI in mind.
I guess essentially what I am looking for is to call RunUserInterface() from main.exe and control the GUI from tests.dll. Is this at all possible, or should I be using a different approach?
It would be much appreciated if someone could give me some pointers.
Thanks very much
04-27-2010 06:17 AM
Well, in my opinion for such a software design, DLL modules should not directly modify the main GUI.
The main.exe should be responsible from its GUI, so that in case of a GUI modification you should not be have to modify all DLLs.
Also, in this case, there is no problem of accessing global handles, etc.
Instead, you should send "messages" to the main.exe from the test DLLs and the GUI should know what to do with each message.
For messaging between such applications I personally use the DDE library. I find it simple to use.
Your main.exe can setup a DDE server and the test DLLs can attach to it as a client.
Each DLL can send its "steps" to the GUI and the GUI can display them and command the DLL to run each step upon user's selection.
I have seen menchar's posts regarding "shared memory" usage for such purposes.
There might be other options, too.
It is your decision to make.
Hope this helps,
04-27-2010 06:34 AM
Its sounds like you understand what I am trying to do. The method you describe sounds more efficient. I will have a scout around my CVI installation and see if I can find some samples to look at.
Thanks.