Solved

NewBee: I have One Solution with Two Projects, How Do I access the Second Project?

Posted on 2004-08-26
14
165 Views
Last Modified: 2010-04-23
Greetings,

First let me apologize for asking this question, I know it has a simple answer but I am VERY new and need to ask the question anyway. ( I am 60 years young [no lie] and I am trying to learn this stuff on my own..)

I have created a VB.NET application that contains several forms with several controls on each form. I use this application (called 'DataInput')  to add data to a few Access databases. This all works and I have created a Deployment Solution as well.

I have started a second application (called 'DataManager') in a  different Folder. This application has a single form in it which I will use as a MDI parent. (isMDIContainer = True). I have added the 'DataInput' project (DataInput.vbproj) to the 'DataManager' Project by adding an "Existing Project" to the 'DataManager' Solution. I now have a Single Solution that contains Two Projects.

Now here is the embarrasing question. How to I get at the 'DataInput' Forms and Functions from within the 'DataManager' Code?

I guess what I need to know is how to Instantiate an instance of the 'DataInput' project so that the forms can be added as Child forms to the 'DataManager' Parent form.
0
Comment
Question by:rrbecker
14 Comments
 
LVL 27

Expert Comment

by:planocz
ID: 11906141
you can run each project by going and right click in the solution area and set that project to "set as a startup app"

Here is where I found a good example for a starting new in VB.Net
.....http://msdn.microsoft.com/vbasic/downloads/samples/101samples.aspx

Link for ASP programs...

http://msdn.microsoft.com/asp.net/downloads/kits/default.aspx 
 
0
 
LVL 5

Expert Comment

by:thenrich
ID: 11906240
to reference 1 project into another go tot he solution explorer under references  - there should be a tab to reference any project in your solution.
0
 
LVL 17

Accepted Solution

by:
AerosSaga earned 200 total points
ID: 11906490
copy the second project into the same folder as the first, add a reference in the ide.  Be sure you select true for copy locally.  VS will then copy the needed dll into the projects bin folder and you can initiate the class and create a new instance available across the application.  Very useful for modular class design.

Regards,

Aeros
0
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
LVL 2

Author Comment

by:rrbecker
ID: 11906687
Hi thenrich,

When I try your suggestion (which I think is what I need to have happen) I get the following error:

 "A reference to 'ApplicationSet' could not be added. An assemply must have a 'dll' extension in order to be referenced."

So, how do I get my 'ApplicationSetup' project into a dll?

Thanks in advance,

rrbecker
0
 
LVL 2

Author Comment

by:rrbecker
ID: 11906764
Hi Aeros,

".....copy the second project into the same folder as the first, add a reference in the ide.  Be sure you select true for copy locally....."

I don't think this is quite what I am after nor do I think it is the required approach. I have some examples of some Very large projects that expand multiple folders and are all brought together in a main folder. The MAIN project folder has a minimum amount of 'Files' in it but the MAIN Project. (Main.vbproj) has all of the other Projects Referenced in to the MAIN project.

My problem is that I Don't Know how it was done.

Thanks for your reply.

rrbecker
0
 
LVL 17

Expert Comment

by:AerosSaga
ID: 11906774
if your writing a windows application then I'm sure they can be, I am an ASP.NET developer, so that is why I put that in.

Regards,

Aeros
0
 
LVL 2

Author Comment

by:rrbecker
ID: 11906844
Hi Aeros,

I'm sorry, did I ask this question under the wrong Heading?  If so how do I move this question to the Right Heading (VB.NET)


Thanks for your help

rrbecker
0
 
LVL 17

Expert Comment

by:AerosSaga
ID: 11906864
Well you can code ASP.NET applications in VB.NET as well so this forum kinda gets jumbled.
0
 
LVL 2

Author Comment

by:rrbecker
ID: 11906947
Hi Aeros,

"....Well you can code ASP.NET applications in VB.NET as well so this forum kinda gets jumbled..."

Ok, Thanks for the info. Like I said, I'm a NewBEE...

rrbecker
0
 

Expert Comment

by:dubbs2003
ID: 11907996
In your DataManager.vb, if you want to create child instances use

Dim DataInput As New DataInput
DataInput.MdiParent = Me  'This links created child form to parent
DataInput.Show()
0
 
LVL 2

Author Comment

by:rrbecker
ID: 11908192
Hi dubbs2003,

That would work (and I already know how to do that) IF there was an intrinsic Reference to the 'DataInput' form, and there inlies my problem. If you refer back to my original description you will see:

 "....I have added the 'DataInput' project (DataInput.vbproj) to the 'DataManager' Project by adding an "Existing Project" to the 'DataManager' Solution. ...."

While this process does add the DataInput project to the DataManager I can't figure out why there is not a intrinsic Reference created so that I can do those things represented in your suggestion.

In other words if I add your suggested to code I will get the following error:

"Type 'DataInput' is not defined."

This is the problem that I an trying to correct.

Thanks for your response.

rrbecker
0
 
LVL 2

Author Comment

by:rrbecker
ID: 11991878
Hi All,

I still haven't found the answer to this question/problem. Do I need to increase the Point Value? Or is it just one of those things that is just not doable?

rrbecker
0
 
LVL 2

Author Comment

by:rrbecker
ID: 12079944
I going to award the points to AerosSaga because some of my development requirements have changed and I am now working with both ASP.NET and VB.NET.

I still don't have the full answer but Aeros is answering the ASP part of my new requirements.

Thanks Aeros,

rrbecker
0
 
LVL 17

Expert Comment

by:AerosSaga
ID: 12079962
Your very welcome rrbecker, hows it goin?
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question