Home All Groups Group Topic Archive Search About

Adding modules from another project

Author
12 May 2006 10:50 PM
Bill Nguyen
I would like to include a module from another project. When I added existing
item, VS copied the module to the current project's folder so that whatever
I did to this module doesn't reflect in the original module. this is NOT
what I expected.

Is there a way to share  a module (.vb) among multiple projects?

Thanks

Bill

Author
12 May 2006 11:14 PM
Dennis
I believe you can add the module as a Project instead of a module.  You can
have several projects within a solution and several solutions can share the
same project. The project is NOT copied to the current solution but remains
and whatever you do to it, changes it for all solutions using the same
project.
--
Dennis in Houston


Show quoteHide quote
"Bill Nguyen" wrote:

> I would like to include a module from another project. When I added existing
> item, VS copied the module to the current project's folder so that whatever
> I did to this module doesn't reflect in the original module. this is NOT
> what I expected.
>
> Is there a way to share  a module (.vb) among multiple projects?
>
> Thanks
>
> Bill
>
>
>
Author
12 May 2006 11:23 PM
Bill Nguyen
Dennis;

Can you please elaborate on the following scenario:

Projects:

1. MasterSolution: in folder \VS2005\MASTER
This project contains module Master with Class MasterData wich in turn
contains Functions ReadData and UpdateData

2. XMLProject: in folder \VS2005\XML

This project needs to use both functions ReadData and UpdateData in
MasterSolution project.


What is the correct way to setup the solution to achieve this goal?

Thanks

Bill


Show quoteHide quote
"Dennis" <Den***@discussions.microsoft.com> wrote in message
news:1E342B2C-D9A8-4BDC-888C-7468E3A6AEB2@microsoft.com...
>I believe you can add the module as a Project instead of a module.  You can
> have several projects within a solution and several solutions can share
> the
> same project. The project is NOT copied to the current solution but
> remains
> and whatever you do to it, changes it for all solutions using the same
> project.
> --
> Dennis in Houston
>
>
> "Bill Nguyen" wrote:
>
>> I would like to include a module from another project. When I added
>> existing
>> item, VS copied the module to the current project's folder so that
>> whatever
>> I did to this module doesn't reflect in the original module. this is NOT
>> what I expected.
>>
>> Is there a way to share  a module (.vb) among multiple projects?
>>
>> Thanks
>>
>> Bill
>>
>>
>>
Author
13 May 2006 10:49 AM
AMercer
> Is there a way to share  a module (.vb) among multiple projects?

Project
  Add Existing Item
    Browse to the file and select it
      Click the dropdown gizmo to the right of the Open button
        Link File

This is the way it works in .net 2003, I assume roughly the same in 2005.  A
file is added normally in one project and then referenced as a link file in
other projects.  Edits made to the file from any project are seen in all
projects.

I do this with one form file, two source files containing a few modules and
classes, and a few .wav and .ico files.  They reside in a utility project
which contains test drivers for rigorous regression testing.  All other uses
of these files are as link files in vb .net projects that create windows form
apps.

The alternative is a class library project referenced by the apps, but I am
satisfied with sharing code via source code link files.
Author
15 May 2006 6:52 PM
Bill Nguyen
AMercer;

This seems to be working. Thanks a lot.

Now that I would like to create a startup form in MasterSolution to call the
Main form in other projects, how do I make sreference to these forms without
having to open them in MasterSolution as a link form. Would this be
possible?

Thanks

Bill

Show quoteHide quote
"AMercer" <AMer***@discussions.microsoft.com> wrote in message
news:215E2359-E969-4861-884D-B6B30CA3C38F@microsoft.com...
>> Is there a way to share  a module (.vb) among multiple projects?
>
> Project
>  Add Existing Item
>    Browse to the file and select it
>      Click the dropdown gizmo to the right of the Open button
>        Link File
>
> This is the way it works in .net 2003, I assume roughly the same in 2005.
> A
> file is added normally in one project and then referenced as a link file
> in
> other projects.  Edits made to the file from any project are seen in all
> projects.
>
> I do this with one form file, two source files containing a few modules
> and
> classes, and a few .wav and .ico files.  They reside in a utility project
> which contains test drivers for rigorous regression testing.  All other
> uses
> of these files are as link files in vb .net projects that create windows
> form
> apps.
>
> The alternative is a class library project referenced by the apps, but I
> am
> satisfied with sharing code via source code link files.
>