I have a small application that when deployed using the Wizard gives a divide by zero just as the install application starts. It runs fine from the IDE, however.
*scratching head*
Any ideas??
Michael
Printable View
I have a small application that when deployed using the Wizard gives a divide by zero just as the install application starts. It runs fine from the IDE, however.
*scratching head*
Any ideas??
Michael
Have you tried it using Inno. I have seen that Inno works better than PDW. Take a look at www.jrsoftware.com.
Coming to your problem, where exactly does it start giving the error? Is it during the wizard, or at the end or while you are installing the application.
It gives the error just as I run the program.... the first thing the program does is popup an inputbox and it gives the error when that pops up.....
I looked at inno but it seemed to be totally confusing...... oh well
Michael
Can you post the code? I guess it is not a problem with PDW now, seems like the code is doing something that makes it throw an error.
here is the code.... as long as you don't critique it lol
Private Sub Form_Load()
Dim msg As Variant
Dim folder As String
Load Me
start:
intInterval = InputBox("Enter a number (5,10,20,30)", "Setting Interval", 30)
If intInterval <> 5 And intInterval <> 10 And intInterval <> 20 And _
intInterval <> 30 Then
msg = MsgBox("Error:Invalid number", vbExclamation, "Try again")
GoTo start
End If
lblPop.Caption = "Last occurance of timer pop (" & intInterval & " mins)"
End Sub
Try these changes (additions and changes in red, deletions in green):VB Code:
Private Sub Form_Load() [COLOR=Red]Dim intInterval [COLOR=Red]As[/COLOR] Integer[/COLOR][COLOR=Red], blGotInterval [COLOR=Red]As[/COLOR] Boolean[/COLOR] 'Dim msg As Variant 'Dim folder As String 'Load Me [COLOR=green]'<- if the form isn't loaded this isn't going to run 'IOW, there's no reason for this line[/COLOR] [COLOR=Green]'GoTos are bad programming practice[/COLOR] start: Do intInterval = InputBox("Enter a number (5,10,20,30)", "Setting Interval", 30) [color=red]Select [/color][COLOR=Red]Case[/COLOR][color=red] intInterval[/color] [COLOR=Red]Case 5, 10, 20, 30[/color] [COLOR=Red]blGotInterval = [/COLOR][COLOR=Red]True[/COLOR] [COLOR=Red]Exit Do[/COLOR] '[COLOR=Green]If intInterval <> 5 And intInterval <> 10 And intInterval <> 20 And _ intInterval <> 30 Then[/COLOR] [color=red]Case Else[/color] [COLOR=Red]MsgBox "Error:Invalid number", vbExclamation, "Try again" [/COLOR] [color=red]End Select[/color] 'GoTo start 'End If [COLOR=red]Loop [COLOR=Red]While[/COLOR] not blGotInterval[/COLOR] lblPop.Caption = "Last occurance of timer pop (" & intInterval & " mins)" End Sub
Very nice.... thank you for the code corrections. I usually do not use go to's but I didn't take the time to do it right.....
Again, thanks.... this code runs, now to see if it deploys correctly
Michael
I still get a divide by zero just as the application initiates, even with making the code changes suggested.
Any ideas????
Run time error (11).... divide by zero.
Move the code to the Form_Activate event.
Moved
change this to a message box for now .. or comment it out, and see what it does once installed ..
lblPop.Caption = "Last occurance of timer pop (" & intInterval & " mins)"
You may not be deploying all the dependency files...
I deleted the whole inputbox portion of the code and it works fine, having a hard coded value in it. That is what I get for trying to put in a little flexibilityQuote:
Originally Posted by rory
Michael