Link to home
Start Free TrialLog in
Avatar of pclarke7
pclarke7

asked on

Sharing a Class between two executables

Hello,
I have an executable PROJ001.exe  which creates a global class called "RBSTrans" which allows all of the forms within this project to have access to the same instance of this class. PROJ001 now needs to call a number of new executables (ie PROJ002, PROJ002, PROJ003 etc...) . How can I make the instance of class RBSTrans available to these new projects (executables). An example would be great.

regards
Pat
Avatar of kaufmed
kaufmed
Flag of United States of America image

I'm not sure I understand your environment, but if PROJ001.exe is a .NET executable, then you can add a reference to that assembly in each of your other applications. As long as the relevant classes are declared public, then you can create instances of this class in those other applications.
Avatar of pclarke7
pclarke7

ASKER

Thanks for that,
how do I add a reference to PROJ001.exe in PROJ002 and if PROJ001.exe already has an instance of my public Class , can PROJ002 reference the same instance ?

regards
Pat
ASKER CERTIFIED SOLUTION
Avatar of kaufmed
kaufmed
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks for your help Kaufmed, based on this answer I will swap over to DLL

regards
Pat