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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB 6 application hangs on startup

Status
Not open for further replies.

cj92713696

Programmer
Nov 23, 2000
105
US
I'm having an unusual problem w/an application I've written in VB 6 (SP5). It uses MSADO 2.7, Crystal Reports 9, and connects to an Access database (2000). When my app. first starts, it literally just hangs. If you get into task manager, you see the app. name as running, but you don't see it on the screen. To prevent my users from running several concurrent instances, I check the App.PrevInstance global VB variable to ensure its state is false. If I try to run the app. a second time, after the 1st instance hangs, I get my programmed error message alarming me that the app. is already running. Has anyone else experienced this problem? Is there a way I can force my app. to display itself on a form_load() event?

Thanks,
CJ
 
Just check under Project|Properties what the Startup object is set to.

If it's set to Sub Main then you need to do a Form.Show somewhere
________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'People who live in windowed environments shouldn't cast pointers.'
 
I'm using MDI child forms. I have a MDI child form specified under Project|Properties. The problem is my program works sometimes. On occassion it will just hang.

Any ideas?
 
Have you tried debug/single-step from the beginning of the startup object? Set a breakpoint at the very beginning and see observe the execution.
 
Suggestion.
Use a sub Main as startup object.
Show a splash screen as a first thing.

while (not all things loaded/initialised)
Before each action do change label on a splash form, saying what you are going to do.
doEvents
loop

Like,
"reading INI files"
"connecting DB"
"loading forms"
etc

- so you just may find out there it hangs.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top