Wrox Programmer Forums
|
Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 18th, 2003, 05:21 PM
Authorized User
 
Join Date: Aug 2003
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default Splash form problems

I have a VB6 SP5 application that compiles and runs. When I run the application in Visual Studio, VB6 crashes after about 2-4 start/stop cycles for the application. I stop the application by clicking on the application's exit button, not through the toolbar in visual studio. If I compile and install the application it does not crash (i.e. exhibit this behavior).

I tracked down the point of failure and it occurs when the application loads the splash form (about 4 lines into the code!). Note, the application only crashes when it is loading the splash form and not when the application exits.

The splash form only has a couple of labels and 2 bitmap images. If I remove the images from the splash form, the application does not crash in Visual Studio. I added the images to the splash screen at design time using the Picture property.

I hope I am not chasing ghosts, but it bothers me that my app makes VB6 crash consistently when run from Visual Studio.

I would appreciate any and all suggestions for solving this problem!

Thanks!

Mark

Code for the splash form:
Code:
Option Explicit

Private Sub Form_Load()
  With Me
    .Top = (Screen.Height - .Height) / 2
    .Left = (Screen.Width - .Width) / 2
    .lblTitle.Caption = gTITLE
    .lblProduct.Caption = gPRODUCT
    .lblVersion.Caption = "v" & App.Major & "." & App.Minor & "." & App.Revision
    .lblDescription.Caption = gDESCRIPTION
    .lblNotice.Caption = gNOTICE
  End With
End Sub

Private Sub Form_KeyPress(KeyAscii As Integer)
    Unload Me
End Sub

Private Sub Form_Terminate()
    'Debug.print "*** Terminate frmSplash"
End Sub
Code in SubMain to launch the app:
Code:
Sub Main()
    On Error GoTo ErrorHandler
    'show the splash screen for a minimum of SPLASH_SCREEN_DELAY milliseconds
    'while getting everything ready
    m_blnTimerDone = False
    m_blnLogEnabled = False
    m_lngTimerID = SetTimer(0, 0, SPLASH_SCREEN_DELAY, AddressOf Timer_CBK)
'    frmSplash.Show
    frmTest.Show
    DoEvents
    '...and we crash before DoEvents!
 
Old November 19th, 2003, 05:02 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

Maybe nothing to do with it, but the params you're passing to SetTimer don't look right. Isn't the first arg supposed to be either a window handle (e.g. Me.hWnd) or Null?





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to createa Splash Screen awais_syed Beginning VB 6 3 August 24th, 2007 03:29 AM
Splash form umeshtheone Beginning VB 6 1 June 26th, 2007 06:27 PM
splash screen query demac43 Visual Basic 2005 Basics 2 May 15th, 2007 03:20 PM
splash form property changes problem Derek_05 Access VBA 1 January 17th, 2006 10:54 AM
Splash Screen dodorisio Beginning VB 6 3 March 25th, 2004 08:29 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.