Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<blockquote> <p>I want the other components to connect to the GUI that's already running, rather than start a new instance of the exe.</p> </blockquote> <p>The trick is to remember that in a ActiveX EXE it can be setup so that there is only one instance of the LIBRARY running. It is correct that you can't reach and just pluck a given instance of a class across process boundary. However the ActiveX EXE can be setup so that the GLOBAL variables are accessible by ANY instance of classes. </p> <p>How to exactly to do this gets a little complex. You can use a ActiveX EXE as a normal EXE the main difference is that you HAVE to use Sub Main. You can also check to see if it run standalone or not. Now I am assuming this is the case with MarkJ's application. </p> <p>If this is the case what you need to is create a application class and set it up so that that when it is created (by using Class_Initialize) that it is populated with the current running instances of forms and collections. </p> <p>I strongly recommend that you create an ActiveX DLL (not EXE) that has nothing but classes to implemented as interfaces. Instead going of going</p> <pre><code>'Class ThisGUIApp Public MainForm as Form </code></pre> <p>You create an interface that has all the properties and methods needed to access the elements of the mainform. Then you go</p> <pre><code>'Class ThisGUIApp Public MainForm as IMainForm Private Sub Class_Initialize Set MainForm = frmMyMainForm End Sub 'Form frmMyMainForm Implements IMainForm </code></pre> <p>You do this because while you can send a Form across application process things get wonky when you try to access it members and controls. If you assigned via an interface then the connection is a lot more solid. Plus it better documents the type of things you are trying to do.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload