tags:

views:

1441

answers:

4

I have a Visual Basic 6.0 SP5 EXE project that results in a .EXE file. This project references some custom DLL's (also made with VB6 projects).
This EXE and DLL's run OK on another machine.

Now I made some changes to the EXE source code. These changes run fine in the VB6 IDE. Then I create the EXE file by running a Make. The generated EXE file run OK on my machine. Next, when copying that EXE file to the other machine, overwriting the original file, and then running it, nothing happens. The EXE doesn't even start as far as I can tell and I don't see a task appearing in the Task Manager.

Not sure what is happening here. Anybody has seen this behavior and has an idea what is happening here?

+2  A: 

Did you modify the DLLs you have dependencies on? Try copying over the custom DLLs as well.

EndangeredMassa
A: 

You probably need to run REGSVR32 to register the COM objects in those DLLs or EXEs. (VS IDE does this for you automatically)

Scott Evernden
+1  A: 

It's worth ensuring the custom DLLs are identical on the two machines, and that they are registered with regsvr32. Although if they weren't, you should get an error message or an error would be raised in your program, rather than what you describe.

Check the code in your startup procedure - Sub Main() or the Form_Load() event of your main form depending on your project settings. Make sure it's not quitting the program if an error occurs.

Check for any Event Viewer messages (based on this answer by Valentin Galea which helped diagnose a VB6 app bailing on a corrupted database file).

Add logging messages to the startup procedure. The native VB6 App.LogEvent method might be useful. Make sure the first line in the program is a logging statement so you can check whether it starts at all. If you have an error handler in the startup procedure, make sure it logs error details before it does anything else.

MarkJ
A: 

I would definitely follow the advice about looking for a cause in the event viewer. But I think you also need to get a proper deployment method.

First I would install service pack 6 for VB6 so you are on the latest. Then I would make a proper msi installer.

To do this you'll need:

Visual studio installer 1.1 from MS.

Merge modules for VB6 SP6.

The merge modules need to be extracted over the existing merge modules that come with visual studio installer and are found in C:\Program Files\Microsoft Visual Studio\COMMON\Tools\VSInst\BuildRes Then I would create an msi installer and use that to deploy your app. It will register the dlls for you and make sure the dependencies are installed.

To create an installer:

1) Open visual studio installer
2) Pick the VB Installer package type in the wizard
3) Change the name to the name of your project
4) Change the location to where you want the installer package to be created (I typically create a folder under the project called Install)
5) Choose create Installer, not merge module (unless you want to package up dependencies for a subproject)
6) Pick the existing VB project to deploy
7) Under Files on right add any other files that aren't straight dependencies (documentation or other related files)
8) Under Build Menu -> Build Configuration change it to release.
9) Click File System, then Application Folder, change the default install folder to be <company name>\<app Name>
10) Right click and Delete unneeded/bad dependencies.  For example MDAC.msm doesn't normally need to be deployed by the app.
11) Change ActiveX dlls to be self register in properties.
12) Under File System, User's Start Menu - Add folder hierarchy User's Start Menu -> Programs -> <company name> -> <app name>
13) Drag system created shortcut to app from User's Start Menu to the App Name folder.  Rename as appropriate.
14) Add shortcut to user's desktop folder if desired
15) Add any other file shortcuts (say to documentation) in the App Name folder or user's desktop
16) Under User Interface, click all the leaf nodes (like the welcome screen) and change the banner bitmap if you have one.
17) Configure Project Properties as appropriate (I fill in support information and update version number)

Build -> Build

THe msi file will be created in a subfolder of the install folder.
Whenever you make a new exe you just open the existing visual studio installer project and choose build->build.  It will create a new msi for you.
Will Rickards