conversion from vb6 (ide) to - specific qustion on use the "common utility".vb

I have a specific question on how to structure the program.

In our situations, many of our applications that written in vb6, have a common utility section of the code that contains all the common functions, and subroutines.   These functinos and subtoutine/methods are used by our various applications.

I know in, there is a way to put all this common utility in a places say called "common_utility.vb", and can be referedor called by every program.  either from debugging purpose or compiled exe versions.   This is very similiar to "%include source_code_path"  in other procedures language, such as PL1.

Is there anyway, we can have the similar way to structure of our current vb6 source code in this fashion?  so the vb6 -> wizard can convert the vb6 to in a more clean and easy way?

ps.  we have good reason not to use DLL for this cases.

thank you for your help
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mshox1Author Commented:
why there is NO one give any attention to this qustions?
it has been over 7 month from the time I request.

is the statement like following

imports common_utility.vb


Please response

thank you
Chris WatsonSoftware DeveloperCommented:
The standard for this would be to place the code you want to share in a separate assembly and reference it from the assemblies you wish to consume the shared functionality. However, as you've already ruled this out, there's nothing stopping you linking the same file to multiple projects in a solution. If the projects in which you wish to consume the shared functionality are not in the same solution perhaps you could achieve the same effect by way of svn:external properties (or whatever equivalent is offered by whichever version control system you are using).
Jacques Bourgeois (James Burger)PresidentCommented:
In each project that needs to use common_utility.vb, do the following, starting in the Project menu:

Add Existing Item...
Navigate to the directory that contains common_utility.vb, and select it, do not double click.
Instead of clicking normally on the Add button, open it with the little triangle at the right side of the button.
Select Add As Link

All the projects will now link to that single source code file. Make a change in the file and all the projects will get it.

This being said, what is the good reason not to use a dll? They are most of the time a better solution.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Get Blueprints for Increased Customer Retention

The IT Service Excellence Tool Kit has best practices to keep your clients happy and business booming. Inside, you’ll find everything you need to increase client satisfaction and retention, become more competitive, and increase your overall success.

mshox1Author Commented:
I like add as Link ideal.  I will give it a try to make sure it works the way I antifipate.

to answer your questions why not use dll.   the reason I do not want to use dll is that in our situations, we frequently need to use "debug" mode to execute some simple or temp change modifications.  -- we even not save the changes.   use "link", then we can step through the "common.vb" code to control the process.   if we use dll approach, we need to be engage a formal change control process...  this is just a trade off between 2 approach that best suite our working enviorments.

I will close the solutions after I get a chance to experiement/verify your approach.  thanks again
Jacques Bourgeois (James Burger)PresidentCommented:
In .NET, you can step through the dll code when you debug the application.

Simply build your projects as a solution.

Open one of your application projects and File...Add...Existing project. Go to the code source of your dll and click Open. Your Solution Explorer now have both your application and your dll.

If you reference the dll as you usually do, the reference is to the compiled dll, and you won't be able to step through the dll, so you must set your reference to the source code instead of the dll. To do that, once you are in the References window, go into the Projects or Solution tab (depending on your version of Visual Studio), and reference your dll from there.

The source code of the application is linked with the source code of the dll. While debugging, when you go step by step in the application and you encounter a call to the dll, the debugger will step into the source code of the dll.
mshox1Author Commented:
thank your addtional experts comments of can debug and step throught the DLL.  I will give addtional considerations.

Lets discuss further of "add as link" to the project.  is there a similar way in vb6?   I like to start from VB6. set the common_utility.bas as the link to my project.   I will then use that as the base to apply the converstion wizard provided by 2008 vb express.   any new program after my converstion done, will for sure use "add as link" method to construct the source code.

Please advise
Jacques Bourgeois (James Burger)PresidentCommented:
In VB6, the equivalent of Add As Link is the default when you add an existing item to a project. So you have it automatically. But it does not show the little arrow indicating a link, so it is prone to errors, because programmers who work in a project do not know that the same file is shared between different projects.

I do not know how the converter will behave with that however.
Martin LissOlder than dirtCommented:
I've requested that this question be deleted for the following reason:

The question has either no comments or not enough useful information to be called an "answer".
Chris WatsonSoftware DeveloperCommented:
There's plenty of pertinent information here, especially from James Burger. I don't agree with this question being deleted.
Jacques Bourgeois (James Burger)PresidentCommented:
I agree with Chris Watson.
mshox1Author Commented:
agree, this solutions have plenty of information.  consider solved.  thank you
Martin LissOlder than dirtCommented:
How did I wind up with the points? I definitely shouldn't get them.
mshox1Author Commented:
sorry for my late response.  I consider this solution closed.  I would like give Mr. Berger full credit for his solutions.  thanks
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.