Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Frustrated with VB file management (prjcts,frms,cls's, etc) 1

Status
Not open for further replies.

Quehay

Programmer
Feb 6, 2000
804
US
I'm still a relative neophyte but I do pretty well already writing code and developing logical and overall flow structures. HOWEVER, I am so bloody frustrated working with VB files. I don't write a process plan in advance and name all my forms, projects, modules, etc. acc. to a definite scheme and never rename (being a bit hyperbolic)--that is I hack with a project and then want to be able to pull the parts that work and put them in a new assemblage.

I'm constantly looking for objects and not find them, even with the "All Files" delimiter. Then I find things and put them together only to find that they don't run on a floppy with another machine, even after testing with restarted copy of VB.

To get to the point: I have yet to see a good explanation of what is going on beneath the surface in how VB looks for the necessary parts of a project (simple no dlls) and gives up when they aren't right at hand. Is this a VB weak point or one in my own ability to understand the environment?

Thanks for listening. . .thanks in advance for insight!
 
Quehay,

I'm guessing on your exact situation but what it sounds like is that you have two VB projects with objects in them that you want to merge the two to create one application. If this is your situation (???) your breaking the dependencies of each project to create one project. This will not work. You simply can't create a project by using windows explorer to merge objects together to create an application. I suggest creating one project and manually coding your objects that you want (or even adding the objects if they were distributed as an ActiveX.exe component). If you find that you no longer need an object that you have in your project then remove it by right clicking in the project window. Once you have an application that works for you... then use the package and deployement wizard that is distributed with Visual Studio. This wizard will automatically set up your dependencies so that it will run on another machine. Remember to create an exe to use with the package and deployement wizard. Also remeber to add .ico's .bmp's etc. (any other graphics etc that your app uses) to the package and deployement wizard. Your app will be dependent on these too.

Hope this helps and applies to your situation.

tschock
 
Tschock: Thanks for your response! I guess that to be able to understand, see, and control the dependencies actively requires working in C+. . .
 
Read Margaret's message here. She did a great job explaining how this works!

thread222-37722

Her response after mine hit the nail right on the head. Snaggs
tribesaddict@swbell.net
 
Thanks for the response and reference (Thank you Margaret--you now have a "white paper" residing on my hard drive!).

Still a question (and perhaps a collective sigh from the more adept programmers out there): What makes a project hang together and how can this be explicitly manipulated? I want to be able to: (1) Create boilerplate forms, classes, etc., as independent objects in objects folders and insert them to projects without trying to remember which project holds them in its grasp (and apparently in its blanket of stealth that blinds Windows Explorer ) and (2) Make the new projects with these assembled elements available for placement in a new context as a cohesive unity that runs without "Can't find what you put in my hands directly--continue loading?" error messages.

I hope this query is constructive for the discussion and not too elementary.
 
If I understand your question correctly, you can build the boiler plate type form, class, etc. and load them into Visual BASIC at will. Open a new project, then right click in the project window and tell it to add a form. Under the new tab, you'll have several options. Some options should be "About Dialog", "ODBC Login", "Splash Screen", etc... There is a directory that holds this information. Typically it's:

C:\Program Files\Microsoft Visual Studio\VB98\Template

Then you'll have the following directories:

Classes
Code
Controls
Forms
MDIForms
Menus
Projects
Proppage
Userctl
Userdocs

Create the boiler plate form, class or code and then save it to one of these directories. Then when you add a new form, class or code, your boiler plate option will show up.

This means that you don't have to remember what project the template was in or where you saved it. Just pick the one you want from Visual BASIC's Add --> <Some object> menu.

Just looking out in the Projects directory, it looks like it's full of designers. However, since you now have access to question #1, it might make building the projects you mention in question #2 much easier.

One other option is that if you're using SourceSafe, you can build a generic project and then check it in under a generic name. Then when you want to build a project similar to that, you just &quot;Get latest version&quot; to a different directory. ie:

MDIAppWith3ChildForms would be a project name that might be checked in from C:\VB\Templates\MDIAppWith2ChildForms. In SourceSafe, this is the working directory. When you get ready to make a new application from this template, &quot;Get the lastest version&quot; from the project in SourceSafe, but direct the files to a different sub-directory.

Hope that helps. Snaggs
tribesaddict@swbell.net
 
Snaggs--thanks for weighing on this twice! The template file strategy is definitely a good one for successful creations--I'll keep the prototypes in projects, e.g,
&quot;New_Unbound_AddRcd_frm_protype&quot; until they're worthy of exporting out into templates.

Cheers!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top