Multiple References and Object Instantiation??

C

Charles A. Lackman

I am working on a application that has many custom made dlls. Actually, for
this app each dll is a different form. I am able, with no problem to
reference and instantiate them to use their public properties and methods
with no problem. But, if one dll is trying to access another dll's
properties (this does not work very good) the project tries to copy the dll
to the directory which already contains the dll and the app will not
compile. I have tried different ways to work around this, ie.

Create a Class that instantiates all the forms from the dlls and reference
the Class from whatever needs them. I can reference them just fine but
cannot instantiate anything. Basically I am referencing a reference from a
reference.

Is there a way to Globally include all the dll's in the project using a
config file or something so that once the dll is referenced, it is
accessible by everything that is referenced from the Main App and Eachother?

I don't believe this is very efficient and would greatly appreciate any
suggestions, on better ways to accomplish this. The basic plan is to have
all the forms independant of the Main App so that if a single form is
changed all that is needed is to updated is the corresponding dll.

Thanks,

Chuck
 
S

Sijin Joseph

Well basically what you are doing is creating a plugin architecture for
your application. What you need to do in this case is to facilitate
communication between the plugin forms using Interfaces. The interface
will be common and you will be passing a reference to the interface
between the forms rather than passing the actual form objects.

check out these articles on CodeProject about Plugin architectures

http://www.codeproject.com/csharp/C__Plugin_Architecture.asp
http://www.codeproject.com/csharp/pluginmanager.asp
http://www.codeproject.com/csharp/PluginsInCSharp.asp
http://www.codeproject.com/dotnet/SMRefactorAddinArticle.asp

Let me know if you need further help.

Sijin Joseph
http://www.indiangeek.net
http://weblogs.asp.net/sjoseph
 
C

Charles A. Lackman

Hello,

Thank you for your help. I still have to problems. I will Domonstrate what
I am experiencing:

(Main App.exe) ->instantiates as mdiChild->(Customer.Dll)->sends populated
Dataset to - is also a mdiChild to Main App.exe->(Activity.Dll)

Information is also sent to (Contract.Dll) which is also a mdiChild of Main
App - from both Customer.Dll and Activity.Dll

In the Main Application I was able to make a reference to all the forms (The
Dlls) and instantiate them and have them displayed as mdiChildren, which
works fine. I can send a dataset from the Main App to the Dlls without
problems. The real problem is sending the modified dataset back to the main
app when the form (Dll) has lost focus. Forms (Dlls) are not closed they
are simply hidden. As you can see, the problem is referecing the
Activity.Dll from both the Main App.exe and the Customer.Dll.

The Articles you sent gave me some good ideas, but they are hard for me to
read because they are not in VB.NET. Sorry, anyway, when the Activity Form
looses focus, how do I make the form send a value to the Main App.

In the Main App Load Event I :

Activity.MdiParent = Me
Activity.Show()

The code continues to run using show (cannot use showdialog with mdiParent),
so how would I send a value back to the Main App when the LostFocus event is
fired in the Activity Form?

Could I implement an interface that handles the Activity LostFocus Event?
but if so, how would I determine when the event was fired from the Main App?

Thank You,
Chuck
 
C

Charles A. Lackman

Hello Again,

Yes, I have already done that, as stated in the post below. I am looking
for a way to send data back to the main application when the LostFocus Event
fires in the Child forms.

Thanks,
Chuck
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top