Link to home
Start Free TrialLog in
Avatar of willisp
willisp

asked on

Compiling a Large VB Project

I have a VB project which contains an MDI Form, 30 child forms, and 50 classes. It takes about 15 minutes just to compile this project, even when I only change one class or form.  How can I speed this up? What is the standard or recommendation for projects this large?  Should I put the classes into a seperate projoct and build them as ActiveX Dlls?

Any help is appreciated.  Thanks in advance.
Avatar of VK
VK
Flag of Germany image

Hello willisp !

It depends on what you have to "share".

1. For example if you have to share an arithmetic function you should use a dll (faster because in same process).

2. If you have to share a group of controls used often you should consider using an ocx (user control).

3. If you have to share a copmlete project which offers services to other apps asynchonous you should consider using an ActiveX-Exe.

Set the project type to "binary compatibity" to avoid unnecessary compiling when the interface hasn't changed.

v.k.
Avatar of willisp
willisp

ASKER

Hi VK,

Thanks for the comments, but I noticed that the "binary compatibility" is disabled and I cannot select it.
Try compiling it from the command line to free up the memory used to "draw" the VB environment.  do it as follows.

<Path to VB.EXE> /make <path of project to compile> /out <path to log file>

eg

"C:\Program Files\Microsoft Visual Studio\VB98\vb6.exe" /make "C:\test\test.vbp" /out c:\compile.log
"just to compile" - do you mean build?  There's not much you can do about that because it needs to build each of your objects.  Get a (much) faster PC is the unhelpful suggestion.

If you mean to start the program, you could try starting without full compile each time. (F5 instead of cntrl-F5 or in options).

If you're building an exe to test it, then try testing it from within the IDE instead (even if it's an ActiveX Exe)
... "binary compatibility" is disabled and I cannot select it.

Binary compatibility is only allowed on ActiveX DLLs and ActiveX EXE projects.  I'm assuming yours is a Standard EXE.

Almost all the projects I work on keep all the forms and classes separate.  In addition, I never have more than 10 forms in one project.  I compile all into DLLs. My forms would be compiled into a User Interface (UI) dll and the classes into your Business Objects (BO) DLL.  In this way, if I need to fix something, I am only changing small parts of a whole.  Also, if I ever decide to change my interface, say from VB forms to a Web interface, my objects and business logic are self contained and ready to go.
There's a product I can suggest for this called VB-Build.  You set up the parameters of your project one time, and whenever you need to compile after that it will automatically re-build the objects that have changed and/or any dependencies.  Its quite fast and prevents the beating of opening a project, compiling, opening another, compiling, and so on.

www.vb-build.com 

Note that I don't work for the guys that make this product, we just use it at my office and its quite good for this kind of thing.

Eric
ASKER CERTIFIED SOLUTION
Avatar of VK
VK
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial