473,403 Members | 2,183 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

Multiple References and Object Instantiation??

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

Jul 21 '05 #1
5 1408
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_...chitecture.asp
http://www.codeproject.com/csharp/pluginmanager.asp
http://www.codeproject.com/csharp/PluginsInCSharp.asp
http://www.codeproject.com/dotnet/SM...dinArticle.asp

Let me know if you need further help.

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

Charles A. Lackman wrote:
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

Jul 21 '05 #2
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
"Sijin Joseph" <si***************@hotmail.com> wrote in message
news:Of***************@TK2MSFTNGP09.phx.gbl...
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_...chitecture.asp
http://www.codeproject.com/csharp/pluginmanager.asp
http://www.codeproject.com/csharp/PluginsInCSharp.asp
http://www.codeproject.com/dotnet/SM...dinArticle.asp

Let me know if you need further help.

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

Charles A. Lackman wrote:
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

Jul 21 '05 #3
The simplest solution for you would be for each of the child forms to
implement a property which returned the dataset.

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

Charles A. Lackman wrote:
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
"Sijin Joseph" <si***************@hotmail.com> wrote in message
news:Of***************@TK2MSFTNGP09.phx.gbl...
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_...chitecture.asp
http://www.codeproject.com/csharp/pluginmanager.asp
http://www.codeproject.com/csharp/PluginsInCSharp.asp
http://www.codeproject.com/dotnet/SM...dinArticle.asp

Let me know if you need further help.

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

Charles A. Lackman wrote:
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


Jul 21 '05 #4
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

"Sijin Joseph" <si***************@hotmail.com> wrote in message
news:OW*************@TK2MSFTNGP12.phx.gbl...
The simplest solution for you would be for each of the child forms to
implement a property which returned the dataset.

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

Charles A. Lackman wrote:
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
"Sijin Joseph" <si***************@hotmail.com> wrote in message
news:Of***************@TK2MSFTNGP09.phx.gbl...
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_...chitecture.asp
http://www.codeproject.com/csharp/pluginmanager.asp
http://www.codeproject.com/csharp/PluginsInCSharp.asp
http://www.codeproject.com/dotnet/SM...dinArticle.asp

Let me know if you need further help.

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

Charles A. Lackman wrote:

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


Jul 21 '05 #5
Attach an event handler to the child form , Lost Focus event. In the
event handler get the dataset using the property you have defined and
pass it to the other child form.

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

Charles A. Lackman wrote:
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

"Sijin Joseph" <si***************@hotmail.com> wrote in message
news:OW*************@TK2MSFTNGP12.phx.gbl...
The simplest solution for you would be for each of the child forms to
implement a property which returned the dataset.

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

Charles A. Lackman wrote:
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
"Sijin Joseph" <si***************@hotmail.com> wrote in message
news:Of***************@TK2MSFTNGP09.phx.gbl.. .
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_...chitecture.asp
http://www.codeproject.com/csharp/pluginmanager.asp
http://www.codeproject.com/csharp/PluginsInCSharp.asp
http://www.codeproject.com/dotnet/SM...dinArticle.asp

Let me know if you need further help.

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

Charles A. Lackman wrote:
>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
>
>
>


Jul 21 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

26
by: Desmond Liu | last post by:
I've read articles like Scott Meyer's EC++ (Item 22) that advocate the use of references when passing parameters. I understand the reasoning behind using references--you avoid the cost of creating...
2
by: george r smith | last post by:
I understand that when you compare (using ==) objects you are seeing if they both refer to the same object. My question why or when would you ever use multiple references to the same object. What...
9
by: Graham | last post by:
I have been having some fun learning and using the new Controls and methods in .Net 2.0 which will make my life in the future easier and faster. Specifically the new databinding practises and...
3
by: breeto | last post by:
If you've configured .NET Remoting to use more than one channel of the same type, for example two TcpClientChannels with unique names, when you want to create a proxy to a remote object how do you...
7
by: andrewfsears | last post by:
I have a question: I was wondering if it is possible to simulate the multiple constructors, like in Java (yes, I know that the languages are completely different)? Let's say that I have a class...
5
by: VSP | last post by:
Hi, I have a doubt regarding using references. Please look at the below code. I am using VC++ 6.0 int &i = 10; // Compilation error error C2440: 'initializing' : cannot convert from...
14
by: Dave Rahardja | last post by:
Hi all, Is it possible to prevent _at compile or link time_ the mulitple instantiation of a templated function? In other words, if there exists a function template <typename Tvoid fn(); I...
6
by: Joseph Geretz | last post by:
I have the following class which I am serializing and passing back and forth between my Web Service application and the client. public class Token : SoapHeader { public string SID; public...
2
by: WittyGuy | last post by:
Hi My class looks something like this: class Base { public: Base () {} ~Base () {} // No virtual dtor in the base class private: };
2
by: BobLewiston | last post by:
The concept of delegates (references to methods) per se is new to me (although I used function pointers in C years ago), and although the literature acknowledges that there are significant...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.