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

Open & Close files in a program - VB.net (2005)

Hi All,

This is all new to me so please be patient with me.

What I have is a very large 'Al-In-One' program, not yet complete, that has
over 70 Forms/Modules/Classes in it and needs to be broken up into smaller
programs/modules that can be called from the main program. I understand that
I would need to, via a Click Button to close one part down and open the new
section, but how.

This is where I get stuck, I really have no idea as to how to do this. Can
anyone offer up a way of doing this.

Thank You

22Pom

Sep 17 '08 #1
4 1564
Are you trying to learn how to divide a single project solution (exe) into a
multi-project solution with one or more executable projects and one or more
dll projects?

Alternatively, are you trying to learn how to create a multi-document
interface (MDI) application?

Sorry, I could not figure this out from your post.

"22Pom" wrote:
Hi All,

This is all new to me so please be patient with me.

What I have is a very large 'Al-In-One' program, not yet complete, that has
over 70 Forms/Modules/Classes in it and needs to be broken up into smaller
programs/modules that can be called from the main program. I understand that
I would need to, via a Click Button to close one part down and open the new
section, but how.

This is where I get stuck, I really have no idea as to how to do this. Can
anyone offer up a way of doing this.

Thank You

22Pom
Sep 17 '08 #2
Hi Family Tree Mike,

Thank you for your responses and I'll try to answer you correctly.

I have several Modules and Classes that have common code used by other parts
of the program and more can be done in this area, I'm sure.

My program consists of 4 main product groups each of which has 5 sub
products and as you proceed the screen is closed off. In addition to these I
have forms that open a PDF style catalogue for each product.

Now each product has an entry screen where the user places their
requirements and after clicking to proceed comes back with various
selections. From this list the user closes this off and moves forward to the
next screen.

This new screen allows for Printing the data or moving onto a dimensional
data screen, which also has a printing area. Some of these screens are
common, but it still increases the overall number of Forms, etc. Each screen
has buttons to allow Exit the program or Return to a previous screen, each
time the screen is closed off and the new one opened.

All of these come under the main programs name. So I start a new project and
just keep adding forms etc to the project. This, I beleive, is where my
problem lies and I don't know how to create smaller blocks and have them
linked to the main.

Best Rgds

"Family Tree Mike" wrote:
Are you trying to learn how to divide a single project solution (exe) into a
multi-project solution with one or more executable projects and one or more
dll projects?

Alternatively, are you trying to learn how to create a multi-document
interface (MDI) application?

Sorry, I could not figure this out from your post.
Sep 17 '08 #3
OK, that helps understand your goal. You should probably have a look at
this link: http://msdn.microsoft.com/en-us/library/23x5fk78.aspx. It gives
an overview of multiproject solutions.

The way I see it, you could have the project for the main application, and
four class libraries, one for each of the product groups. Others might
break up the libraries at the sub-product level, giving 20 libraries. There
is really no right or wrong answer here other than the items (forms,
classes, modules) form a logical grouping if they are in the same dll.

I believe you currently have a single project in your solution. To add a
product group library, select "File" then "New Project". For the project
type, select "Class Library". The name can be anything that signifies to
you that it pertains to a particular product group. Before clicking "OK",
make sure that the choice for "Solution" in the dropdown says "Add to
Solution".

Now you can move some of the forms, classes and modules out of the main
project to your dll project. It is likely you will need to add
System.Windows.Forms as a reference to your dll project as it is not added
by default.

When you move your forms and such out of your main project, you should see
errors about missing or undefined types. Those should be fixed by adding a
reference in your main project to the class library project. On the "Add
Reference" dialog, you will see a tab called "Projects" where you can point
to the new project.

The last step is that you will need to add an imports statement at the top
for the namespace from your new library so that the new namespace is
resolved.

Then you would do these steps for each new library you want to create.

Of course, make sure you back up your current solution folder so you can
always get back to the current way you have things!

Hope this helps.
"22Pom" <22***@discussions.microsoft.comwrote in message
news:B9**********************************@microsof t.com...
Hi Family Tree Mike,

Thank you for your responses and I'll try to answer you correctly.

I have several Modules and Classes that have common code used by other
parts
of the program and more can be done in this area, I'm sure.

My program consists of 4 main product groups each of which has 5 sub
products and as you proceed the screen is closed off. In addition to
these I
have forms that open a PDF style catalogue for each product.

Now each product has an entry screen where the user places their
requirements and after clicking to proceed comes back with various
selections. From this list the user closes this off and moves forward to
the
next screen.

This new screen allows for Printing the data or moving onto a dimensional
data screen, which also has a printing area. Some of these screens are
common, but it still increases the overall number of Forms, etc. Each
screen
has buttons to allow Exit the program or Return to a previous screen, each
time the screen is closed off and the new one opened.

All of these come under the main programs name. So I start a new project
and
just keep adding forms etc to the project. This, I beleive, is where my
problem lies and I don't know how to create smaller blocks and have them
linked to the main.

Best Rgds

"Family Tree Mike" wrote:
>Are you trying to learn how to divide a single project solution (exe)
into a
multi-project solution with one or more executable projects and one or
more
dll projects?

Alternatively, are you trying to learn how to create a multi-document
interface (MDI) application?

Sorry, I could not figure this out from your post.
Sep 17 '08 #4
Hi Family Tree Mike,

That helps a lot. As I said right at the beginning, this is all new to me
and by going through the process you outline will help me understand things
better than just dumping code into a program. I will also investigate the
link offered to see what that offers. I suspect that I will Have to spend
lots of time and receive heaps of trouble along the way but thats the only
way of learning things and making them stick in the Grey Matter memory banks.

Thanks again,
Best Rgds,
22Pom

"Family Tree Mike" wrote:
OK, that helps understand your goal. You should probably have a look at
this link: http://msdn.microsoft.com/en-us/library/23x5fk78.aspx. It gives
an overview of multiproject solutions.

The way I see it, you could have the project for the main application, and
four class libraries, one for each of the product groups. Others might
break up the libraries at the sub-product level, giving 20 libraries. There
is really no right or wrong answer here other than the items (forms,
classes, modules) form a logical grouping if they are in the same dll.

I believe you currently have a single project in your solution. To add a
product group library, select "File" then "New Project". For the project
type, select "Class Library". The name can be anything that signifies to
you that it pertains to a particular product group. Before clicking "OK",
make sure that the choice for "Solution" in the dropdown says "Add to
Solution".

Now you can move some of the forms, classes and modules out of the main
project to your dll project. It is likely you will need to add
System.Windows.Forms as a reference to your dll project as it is not added
by default.

When you move your forms and such out of your main project, you should see
errors about missing or undefined types. Those should be fixed by adding a
reference in your main project to the class library project. On the "Add
Reference" dialog, you will see a tab called "Projects" where you can point
to the new project.

The last step is that you will need to add an imports statement at the top
for the namespace from your new library so that the new namespace is
resolved.

Then you would do these steps for each new library you want to create.

Of course, make sure you back up your current solution folder so you can
always get back to the current way you have things!

Hope this helps.
"22Pom" <22***@discussions.microsoft.comwrote in message
news:B9**********************************@microsof t.com...
Hi Family Tree Mike,

Thank you for your responses and I'll try to answer you correctly.

I have several Modules and Classes that have common code used by other
parts
of the program and more can be done in this area, I'm sure.

My program consists of 4 main product groups each of which has 5 sub
products and as you proceed the screen is closed off. In addition to
these I
have forms that open a PDF style catalogue for each product.

Now each product has an entry screen where the user places their
requirements and after clicking to proceed comes back with various
selections. From this list the user closes this off and moves forward to
the
next screen.

This new screen allows for Printing the data or moving onto a dimensional
data screen, which also has a printing area. Some of these screens are
common, but it still increases the overall number of Forms, etc. Each
screen
has buttons to allow Exit the program or Return to a previous screen, each
time the screen is closed off and the new one opened.

All of these come under the main programs name. So I start a new project
and
just keep adding forms etc to the project. This, I beleive, is where my
problem lies and I don't know how to create smaller blocks and have them
linked to the main.

Best Rgds

"Family Tree Mike" wrote:
Are you trying to learn how to divide a single project solution (exe)
into a
multi-project solution with one or more executable projects and one or
more
dll projects?

Alternatively, are you trying to learn how to create a multi-document
interface (MDI) application?

Sorry, I could not figure this out from your post.

Sep 18 '08 #5

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

Similar topics

6
by: Sara Khalatbari | last post by:
Dear friends In a code, I'm opening a file to read. Like : lines = open(filename).readlines() & I'm never closing it. I'm not writing in that file, I just read it. Will it cause any problems...
0
by: Bill Davy | last post by:
I am building a C++ program (main.exe) with VC6 which expects to call the Python DLL. When I start it (under the debugger), I get: "This application has failed to start because python24_d.dll was...
6
by: Dino Buljubasic | last post by:
My application creates some temporary files that are deleted when my application terminates. However, if a temp file is open, it will not be deleted and application will crash. How can I...
6
by: Abubakar | last post by:
Hi, I'm working on a project in unmanaged c++. I was writing all (most of) my code in header files, that is, no seperation of code in header and cpp files, as usually is done in c++. I feel pretty...
4
by: _Mario.lat | last post by:
Hallo, I have a little question: In the function session_set_save_handler I can pass the name of function which deal with session. In Xoops code I see the use of this function like that: ...
1
by: EoRaptor013 | last post by:
Not sure where to ask this question, but... I'm using a TreeView component to enable browsing file folders in a specific directory (for test purposes /Program Files/). Some users use an ampersand...
2
by: Pierre Rouleau | last post by:
Hi all, I have a consistent test case where os.popen3() hangs in Windows. The system hangs when retrieving the lines from the child process stdout. I know there were several reports related to...
7
by: =?Utf-8?B?U2NhbmJveQ==?= | last post by:
Guyz, I have just learnt how to add the 'DriveListBox', 'DirListBox' and 'FileListBox' controls that were always included in the toolbox with VB 3.0 / 4.0 / 5.0, but always missing in VBE 2005....
7
by: stan.kolker | last post by:
HI, I am just trying to open vss: try SourceSafeTypeLib.IVSSDatabase vssDb = new VSSDatabaseClass(); vssDb.Open(@"C:\Program Files\Microsoft Visual...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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
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: 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...

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.