473,387 Members | 1,749 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,387 software developers and data experts.

MDI Children and DLLs

Hi All,

I have a VB.NET MDI application with several MDI Child forms. Each of the
MDI Child forms has a significant amount of code. What I think I would like
to do is create a DLL for each child form, so that if I need to make changes
to a particular form, I can just update the DLL for that form and have the
user download just the new DLL.

From the main menu of the MDI parent, a user selects a particular task,
which generally involves processing information from a particular type of
file. The user selects the file using an OpenFileDialog. then I do a bit of
checking to make sure the file is the right type of file for the particular
task selected. If it is, I open the MDI Child form and pass the filename and
some other information to the form.

From this point, all processing is done from the Child form.

So, is it possible to take the entire form and put it in a DLL? Or can I
only take the form functionality (various subs and functions) and move them
to a DLL?

TIA
Lee
Nov 21 '05 #1
12 2488
Hi,

Billy Hollis did a talk about this at a orlando dot net user group
meeting. Here is a link to the sample code he wrote.

http://www.dotnetmasters.com/Downloa...msOnTheFly.zip

Ken
--------------
"lgbjr" <lg***@nospam.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Hi All,

I have a VB.NET MDI application with several MDI Child forms. Each of the
MDI Child forms has a significant amount of code. What I think I would
like to do is create a DLL for each child form, so that if I need to make
changes to a particular form, I can just update the DLL for that form and
have the user download just the new DLL.

From the main menu of the MDI parent, a user selects a particular task,
which generally involves processing information from a particular type of
file. The user selects the file using an OpenFileDialog. then I do a bit
of checking to make sure the file is the right type of file for the
particular task selected. If it is, I open the MDI Child form and pass the
filename and some other information to the form.

From this point, all processing is done from the Child form.

So, is it possible to take the entire form and put it in a DLL? Or can I
only take the form functionality (various subs and functions) and move
them to a DLL?

TIA
Lee

Nov 21 '05 #2
Hi Ken,

thanks for the reply. And thanks for the link. I see what he's doing and it
looks fairly easy to implement.

One question though. I don't see a way to pass information from the MDI
parent to the dynamically loaded form. I have a feeling this is a trivial
matter, but I'm not sure how to do it.

Regards,
Lee

"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Hi,

Billy Hollis did a talk about this at a orlando dot net user group
meeting. Here is a link to the sample code he wrote.

http://www.dotnetmasters.com/Downloa...msOnTheFly.zip

Ken
--------------
"lgbjr" <lg***@nospam.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Hi All,

I have a VB.NET MDI application with several MDI Child forms. Each of the
MDI Child forms has a significant amount of code. What I think I would
like to do is create a DLL for each child form, so that if I need to make
changes to a particular form, I can just update the DLL for that form and
have the user download just the new DLL.

From the main menu of the MDI parent, a user selects a particular task,
which generally involves processing information from a particular type of
file. The user selects the file using an OpenFileDialog. then I do a bit
of checking to make sure the file is the right type of file for the
particular task selected. If it is, I open the MDI Child form and pass
the filename and some other information to the form.

From this point, all processing is done from the Child form.

So, is it possible to take the entire form and put it in a DLL? Or can I
only take the form functionality (various subs and functions) and move
them to a DLL?

TIA
Lee


Nov 21 '05 #3
Hi All,

To be more specific about my previous post:

Currently, in my MDI Parent Form, I have a public class with public shared
variables that are passed to the MDI child forms.

changing the Child forms to be dynamically loaded (ChildForm.dll), I can't
figure out how to pass the public shared variables to the form when it's
loaded.

Can I expose the public class with my public shared variables in the MDI
parent form to the childform.dll? Or, how do I pass the public shared
variables to the dll?

TIA
Lee

"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Hi,

Billy Hollis did a talk about this at a orlando dot net user group
meeting. Here is a link to the sample code he wrote.

http://www.dotnetmasters.com/Downloa...msOnTheFly.zip

Ken
--------------
"lgbjr" <lg***@nospam.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Hi All,

I have a VB.NET MDI application with several MDI Child forms. Each of the
MDI Child forms has a significant amount of code. What I think I would
like to do is create a DLL for each child form, so that if I need to make
changes to a particular form, I can just update the DLL for that form and
have the user download just the new DLL.

From the main menu of the MDI parent, a user selects a particular task,
which generally involves processing information from a particular type of
file. The user selects the file using an OpenFileDialog. then I do a bit
of checking to make sure the file is the right type of file for the
particular task selected. If it is, I open the MDI Child form and pass
the filename and some other information to the form.

From this point, all processing is done from the Child form.

So, is it possible to take the entire form and put it in a DLL? Or can I
only take the form functionality (various subs and functions) and move
them to a DLL?

TIA
Lee


Nov 21 '05 #4
Lee,

This overlay approach was very nice in MS Dos computers. Your mdi forms are
seperated classes. If you use them right, than they will be consequently be
released by the GC. (With right I mean not creating everything in a shared
way)

The DLL's that you want to create are libarys as is by instance as well the
Net DLL and the MicrosoftVB DLL. The code taken from that will be included
in your exe.

For MDI is that not such a nice approach to create those librarys because
the change that you reuse them is very low. It can of course be a good
approach to create such a library for your own standard usercontrols,
templateforms or whatever.

I hope that this gives an idea

Cor

Nov 21 '05 #5
Hi Cor,

I agree with what you say. The only form that has anything declared as
shared is the MDI parent, and it is nice that once the child form (its own
class) is closed, GC takes out the trash.

I also understand that the purpose of a DLL is really for code that is
reused in many different locations, and that putting a form in a DLL is
contrary to this purpose, since the code for the form is only used by the
form.

My purpose for putting the forms in seperate DLLs is two-fold:
1 - Licensing and distribution - The application is really a compilation of
quite a few tools and depending on what the client purchases, I could reduce
the size of the install package by only including the DLLs for what they
purchased
2 - Upgrades - The MDI parent is not likely to change nearly as often as the
child forms. So, as I make changes to the functionality of a particular
child form, the client can download just a new DLL, rather than a much
larger executable that would include all of the code for all of the child
forms.

Make Sense?

Assuming yes, do you have some idea how I can pass variables from the MDI
parent to one of these dynamically loaded forms?

Thanks!!

Lee

"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:OR****************@TK2MSFTNGP12.phx.gbl...
Lee,

This overlay approach was very nice in MS Dos computers. Your mdi forms
are seperated classes. If you use them right, than they will be
consequently be released by the GC. (With right I mean not creating
everything in a shared way)

The DLL's that you want to create are libarys as is by instance as well
the Net DLL and the MicrosoftVB DLL. The code taken from that will be
included in your exe.

For MDI is that not such a nice approach to create those librarys because
the change that you reuse them is very low. It can of course be a good
approach to create such a library for your own standard usercontrols,
templateforms or whatever.

I hope that this gives an idea

Cor

Nov 21 '05 #6
Lee,

In my opinon describes this page your problem (Net is at the bottom)

I hope it helps something,

Cor
Nov 21 '05 #7
Exactly at the bottom of the message is it not.

http://support.microsoft.com/default...b;en-us;815065

:-)))

Cor
Nov 21 '05 #8
Hi,

I would add a property to the forms stored in the dll to passed the
shared data.

Ken
---------------------
"lgbjr" <lg***@nospam.com> wrote in message
news:%2******************@tk2msftngp13.phx.gbl...
Hi All,

To be more specific about my previous post:

Currently, in my MDI Parent Form, I have a public class with public shared
variables that are passed to the MDI child forms.

changing the Child forms to be dynamically loaded (ChildForm.dll), I can't
figure out how to pass the public shared variables to the form when it's
loaded.

Can I expose the public class with my public shared variables in the MDI
parent form to the childform.dll? Or, how do I pass the public shared
variables to the dll?

TIA
Lee

"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Hi,

Billy Hollis did a talk about this at a orlando dot net user group
meeting. Here is a link to the sample code he wrote.

http://www.dotnetmasters.com/Downloa...msOnTheFly.zip

Ken
--------------
"lgbjr" <lg***@nospam.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Hi All,

I have a VB.NET MDI application with several MDI Child forms. Each of
the MDI Child forms has a significant amount of code. What I think I
would like to do is create a DLL for each child form, so that if I need
to make changes to a particular form, I can just update the DLL for that
form and have the user download just the new DLL.

From the main menu of the MDI parent, a user selects a particular task,
which generally involves processing information from a particular type
of file. The user selects the file using an OpenFileDialog. then I do a
bit of checking to make sure the file is the right type of file for the
particular task selected. If it is, I open the MDI Child form and pass
the filename and some other information to the form.

From this point, all processing is done from the Child form.

So, is it possible to take the entire form and put it in a DLL? Or can I
only take the form functionality (various subs and functions) and move
them to a DLL?

TIA
Lee



Nov 21 '05 #9
Since a form which is an MDIChild has a property "MDIParent", if you
make the variables public properties of your MDIParent, and set a
reference in the mdichild project to the mdiparent, your mdichild would
be able to access the variables directly from the parent:

[mdiparentproject]
[mdiparentform]
public SomeVariable as string
public OtherVariable as integer
sub createchild
'do whatever
end sub
[end form]
[end project]

[mdichild project]
{reference to mdiparent project}
[mdichild form]
sub Form_Load(sender as object, e as eventargs)
dim MyParent as mdiparent.mdiparentform
MyParent=ctype(me.mdiparent,mdiparentproject.mdipa rentform)
me.text=myparent.SomeVariable
end sub
[end form]
[end project]
In message <eB**************@TK2MSFTNGP14.phx.gbl>, lgbjr
<lg***@nospam.com> writes
Hi Cor,

I agree with what you say. The only form that has anything declared as
shared is the MDI parent, and it is nice that once the child form (its own
class) is closed, GC takes out the trash.

I also understand that the purpose of a DLL is really for code that is
reused in many different locations, and that putting a form in a DLL is
contrary to this purpose, since the code for the form is only used by the
form.

My purpose for putting the forms in seperate DLLs is two-fold:
1 - Licensing and distribution - The application is really a compilation of
quite a few tools and depending on what the client purchases, I could reduce
the size of the install package by only including the DLLs for what they
purchased
2 - Upgrades - The MDI parent is not likely to change nearly as often as the
child forms. So, as I make changes to the functionality of a particular
child form, the client can download just a new DLL, rather than a much
larger executable that would include all of the code for all of the child
forms.

Make Sense?

Assuming yes, do you have some idea how I can pass variables from the MDI
parent to one of these dynamically loaded forms?

Thanks!!

Lee

"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:OR****************@TK2MSFTNGP12.phx.gbl...
Lee,

This overlay approach was very nice in MS Dos computers. Your mdi forms
are seperated classes. If you use them right, than they will be
consequently be released by the GC. (With right I mean not creating
everything in a shared way)

The DLL's that you want to create are libarys as is by instance as well
the Net DLL and the MicrosoftVB DLL. The code taken from that will be
included in your exe.

For MDI is that not such a nice approach to create those librarys because
the change that you reuse them is very low. It can of course be a good
approach to create such a library for your own standard usercontrols,
templateforms or whatever.

I hope that this gives an idea

Cor



--
Chris Petchey
Nov 21 '05 #10
Chris,

Thanks for the reply. Seems straight forward, but how do I "set a reference"
to the MDIParent project in the MDIchild project? I right click on
References, select Add Reference, the go to the projects tab and add a
reference to the MDIParent project? When I try this, it says that an
assembly must have a DLL extension to be referenced.

Am I missing something?

regards,
Lee

"Chris Petchey" <ch****@soltec.demon.co.uk> wrote in message
news:nA**************@soltec.demon.co.uk...
Since a form which is an MDIChild has a property "MDIParent", if you
make the variables public properties of your MDIParent, and set a
reference in the mdichild project to the mdiparent, your mdichild would
be able to access the variables directly from the parent:

[mdiparentproject]
[mdiparentform]
public SomeVariable as string
public OtherVariable as integer
sub createchild
'do whatever
end sub
[end form]
[end project]

[mdichild project]
{reference to mdiparent project}
[mdichild form]
sub Form_Load(sender as object, e as eventargs)
dim MyParent as mdiparent.mdiparentform
MyParent=ctype(me.mdiparent,mdiparentproject.mdipa rentform)
me.text=myparent.SomeVariable
end sub
[end form]
[end project]
In message <eB**************@TK2MSFTNGP14.phx.gbl>, lgbjr
<lg***@nospam.com> writes
Hi Cor,

I agree with what you say. The only form that has anything declared as
shared is the MDI parent, and it is nice that once the child form (its own
class) is closed, GC takes out the trash.

I also understand that the purpose of a DLL is really for code that is
reused in many different locations, and that putting a form in a DLL is
contrary to this purpose, since the code for the form is only used by the
form.

My purpose for putting the forms in seperate DLLs is two-fold:
1 - Licensing and distribution - The application is really a compilation
of
quite a few tools and depending on what the client purchases, I could
reduce
the size of the install package by only including the DLLs for what they
purchased
2 - Upgrades - The MDI parent is not likely to change nearly as often as
the
child forms. So, as I make changes to the functionality of a particular
child form, the client can download just a new DLL, rather than a much
larger executable that would include all of the code for all of the child
forms.

Make Sense?

Assuming yes, do you have some idea how I can pass variables from the MDI
parent to one of these dynamically loaded forms?

Thanks!!

Lee

"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:OR****************@TK2MSFTNGP12.phx.gbl.. .
Lee,

This overlay approach was very nice in MS Dos computers. Your mdi forms
are seperated classes. If you use them right, than they will be
consequently be released by the GC. (With right I mean not creating
everything in a shared way)

The DLL's that you want to create are libarys as is by instance as well
the Net DLL and the MicrosoftVB DLL. The code taken from that will be
included in your exe.

For MDI is that not such a nice approach to create those librarys
because
the change that you reuse them is very low. It can of course be a good
approach to create such a library for your own standard usercontrols,
templateforms or whatever.

I hope that this gives an idea

Cor



--
Chris Petchey

Nov 21 '05 #11
Hi lee
you can try using static variables. I am not sure if its possible
or acctually do the tric but as all of the forms are basically class
this just might work.

thanks

w.P.

lgbjr wrote:
Hi All,

To be more specific about my previous post:

Currently, in my MDI Parent Form, I have a public class with public shared
variables that are passed to the MDI child forms.

changing the Child forms to be dynamically loaded (ChildForm.dll), I can't
figure out how to pass the public shared variables to the form when it's
loaded.

Can I expose the public class with my public shared variables in the MDI
parent form to the childform.dll? Or, how do I pass the public shared
variables to the dll?

TIA
Lee

"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Hi,

Billy Hollis did a talk about this at a orlando dot net user group
meeting. Here is a link to the sample code he wrote.

http://www.dotnetmasters.com/Downloa...msOnTheFly.zip

Ken
--------------
"lgbjr" <lg***@nospam.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Hi All,

I have a VB.NET MDI application with several MDI Child forms. Each of the
MDI Child forms has a significant amount of code. What I think I would
like to do is create a DLL for each child form, so that if I need to make
changes to a particular form, I can just update the DLL for that form and
have the user download just the new DLL.

From the main menu of the MDI parent, a user selects a particular task,
which generally involves processing information from a particular type of
file. The user selects the file using an OpenFileDialog. then I do a bit
of checking to make sure the file is the right type of file for the
particular task selected. If it is, I open the MDI Child form and pass
the filename and some other information to the form.

From this point, all processing is done from the Child form.

So, is it possible to take the entire form and put it in a DLL? Or can I
only take the form functionality (various subs and functions) and move
them to a DLL?

TIA
Lee



Nov 21 '05 #12
Compile the mdiparent project and use the browse button on the .net tab
of the add reference dialog

In message <uX*************@TK2MSFTNGP10.phx.gbl>, lgbjr
<lg***@nospam.com> writes
Chris,

Thanks for the reply. Seems straight forward, but how do I "set a reference"
to the MDIParent project in the MDIchild project? I right click on
References, select Add Reference, the go to the projects tab and add a
reference to the MDIParent project? When I try this, it says that an
assembly must have a DLL extension to be referenced.

Am I missing something?

regards,
Lee

"Chris Petchey" <ch****@soltec.demon.co.uk> wrote in message
news:nA**************@soltec.demon.co.uk...
Since a form which is an MDIChild has a property "MDIParent", if you
make the variables public properties of your MDIParent, and set a
reference in the mdichild project to the mdiparent, your mdichild would
be able to access the variables directly from the parent:

[mdiparentproject]
[mdiparentform]
public SomeVariable as string
public OtherVariable as integer
sub createchild
'do whatever
end sub
[end form]
[end project]

[mdichild project]
{reference to mdiparent project}
[mdichild form]
sub Form_Load(sender as object, e as eventargs)
dim MyParent as mdiparent.mdiparentform
MyParent=ctype(me.mdiparent,mdiparentproject.mdipa rentform)
me.text=myparent.SomeVariable
end sub
[end form]
[end project]
In message <eB**************@TK2MSFTNGP14.phx.gbl>, lgbjr
<lg***@nospam.com> writes
Hi Cor,

I agree with what you say. The only form that has anything declared as
shared is the MDI parent, and it is nice that once the child form (its own
class) is closed, GC takes out the trash.

I also understand that the purpose of a DLL is really for code that is
reused in many different locations, and that putting a form in a DLL is
contrary to this purpose, since the code for the form is only used by the
form.

My purpose for putting the forms in seperate DLLs is two-fold:
1 - Licensing and distribution - The application is really a compilation
of
quite a few tools and depending on what the client purchases, I could
reduce
the size of the install package by only including the DLLs for what they
purchased
2 - Upgrades - The MDI parent is not likely to change nearly as often as
the
child forms. So, as I make changes to the functionality of a particular
child form, the client can download just a new DLL, rather than a much
larger executable that would include all of the code for all of the child
forms.

Make Sense?

Assuming yes, do you have some idea how I can pass variables from the MDI
parent to one of these dynamically loaded forms?

Thanks!!

Lee

"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:OR****************@TK2MSFTNGP12.phx.gbl. ..
Lee,

This overlay approach was very nice in MS Dos computers. Your mdi forms
are seperated classes. If you use them right, than they will be
consequently be released by the GC. (With right I mean not creating
everything in a shared way)

The DLL's that you want to create are libarys as is by instance as well
the Net DLL and the MicrosoftVB DLL. The code taken from that will be
included in your exe.

For MDI is that not such a nice approach to create those librarys
because
the change that you reuse them is very low. It can of course be a good
approach to create such a library for your own standard usercontrols,
templateforms or whatever.

I hope that this gives an idea

Cor



--
Chris Petchey



--
Chris Petchey
Nov 21 '05 #13

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

Similar topics

16
by: Laura Conrad | last post by:
I'm writing an application that has to spawn some processes and then kill them later. It doesn't need to talk or listen to them while they're running, but there are stop and start buttons and the...
6
by: Luke Dalessandro | last post by:
I'm not sure if this is the correct forum for platform specific (Mozilla/Firefox) javascript problems, so just shout and point me to the correct newsgroup if I'm being bad. Here's the deal... ...
2
by: Johann Blake | last post by:
I can hardly believe I'm the first one to report this, but having gone through the newsgroup, it appears that way. I would like to open a solution in the VS.NET IDE that consists of multiple...
2
by: Shiraz | last post by:
Hi I just made an installer for an application that uses two external COM dlls. On the surface, everything seems to be running smoothly and the the application runs without any errors. However,...
11
by: Devender Khari | last post by:
Hi Friends, I'm facing a situation as follows, need help on identifying possible issues. There is an MFC application developed in VC6.0, say ABCVC6.exe and another developed in VC.NET, say...
0
by: ZMan | last post by:
Scenario: This is about debugging server side scripts that make calls to middle-tier business DLLs. The server side scripts are legacy ASP 3.0 pages, and the DLLs are managed DLLs...
7
by: Oenone | last post by:
I'm sure there's an obvious way to do this, but I'm missing it so far. I have an ASP.NET application that relies on several DLLs to work. Currently in order to get my site working I have to put...
97
by: Master Programmer | last post by:
Thinking of learning VB.NET? New programmer? Thinking of Moving over from VB 6.0? Read on friend, let me help you make a more informed decision......... Microsoft are a pathetic company,...
10
by: =?Utf-8?B?UmljaGFyZA==?= | last post by:
Hi, I usually deploy my ASP .NET application to the server by publishing, using Visual Studio 2005 publish feature. This creates the Bin folder on the server, with the compiled DLLs. I've...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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,...
0
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,...
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...

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.