473,795 Members | 3,331 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1435
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.Dl l)->sends populated
Dataset to - is also a mdiChild to Main App.exe->(Activity.Dl l)

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.MdiPar ent = 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******** *******@TK2MSFT NGP09.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.Dl l)->sends populated
Dataset to - is also a mdiChild to Main App.exe->(Activity.Dl l)

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.MdiPar ent = 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******** *******@TK2MSFT NGP09.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
communicati on 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
suggestion s, 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******** *****@TK2MSFTNG P12.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.Dl l)->sends populated Dataset to - is also a mdiChild to Main App.exe->(Activity.Dl l)

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.MdiPar ent = 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******** *******@TK2MSFT NGP09.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
communicati on 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
suggestion s, 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******** *****@TK2MSFTNG P12.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.Dl l)->sends
populated
Dataset to - is also a mdiChild to Main App.exe->(Activity.Dl l)

Informatio n 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.D ll 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.Mdi Parent = Me
Activity.Sho w()

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***** **********@TK2M SFTNGP09.phx.gb l...
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
communicati on 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
>referenc e and instantiate them to use their public properties and

methods
>with no problem. But, if one dll is trying to access another dll's
>properti es (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
>referenc e.
>
>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
>accessib le by everything that is referenced from the Main App and

Eachother?
>I don't believe this is very efficient and would greatly appreciate any
>suggestion s, 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
2472
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 a local object when you pass an object by reference. But why use a reference? Is there any inherent advantage of using a reference over using a pointer? My workplace discourages the use of pointers when it comes to parameter passing. They...
2
1913
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 would be a production code type example why you would set objOne = objTwo. Thanks grs
9
2778
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 wizards. But, I have found that trying to do something "outside the norm" adds a rather large level of complexity and/or data replication. Background I have been commissioned to create a web-based application for a client. It has a formsaunthentication...
3
14479
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 specify which channel you want that proxy to use? Thanks in advance.
7
16574
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 called "Point" which would have two values "x" and "y". Now, let's say if it were the Java version, I would want two constructors: one that accept two numbers, the other accepts a string:
5
1695
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 'const int' to 'int &' A reference that is not to 'const' cannot be bound to a non-lvalue
14
1779
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 want to prevent the user from doing this: int main()
6
3992
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 string UID; public string PWD; }
2
1881
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
1885
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 differences between delegates and the use of pointers to objects, I'm nonetheless a little confused by how similar the syntax used for references to methods is to that used for references to objects. Recently at a few different forums I posted a brief...
0
9672
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9519
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10435
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10213
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10163
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10000
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9037
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7538
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
2
3721
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.