"Overflow" message at startup

Vivitech

Registered User.
Local time
Today, 07:29
Joined
May 11, 2004
Messages
18
Help! I have a pretty stable (or so I thought!) MDE application but I've just tried to run it on my client's Windows 98 machine and all I get is a message box saying "Overflow!"

The client's PC has Access Runtime installed and this does run other MDE apps OK, so it must be something specific I'm doing in my app, right at startup!

Anyone ever seen anything similar? Or any ideas how to track it down, given that the PC doesn't have Access on it?
 
Last edited:
Found the culprit

Well, I've found the line of code that causes it, so just in case anyone else experiences this:

In my autoexec macro I was calling a Startup() subroutine with some code to run another application when my database is opened:

Code:
Sub StartUp()
   Dim ret As Integer
   ret = Shell("C:\BLAHBLAH\SOMEAPP.EXE", vbMinimizedNoFocus)
End Sub

Interestingly, it was a method I'd seen somewhere, but I'd added the Dim statement because of my liking for Option Explicit.

However, if you look at the help files, Shell() doesn't return an int, it returns a double. I guess that's where the "overflow" is coming from. I guess I'm too used to my C++ compiler doing type checking for me.

Sure enough, if I change ret to be declared as a double, all is well.

Strange that this runs OK on Windows 2K and XP though. Or should that read "annoying"?! In fact, I'm sure at sometime in the past I must have had a version of the App with this type mismatch in it running on Win98 too. Ah well.
 
It returns a double, but if you get a double small enough it can be stored in an integer. So its more luck .... that its working...

Regards
 
Good thinking, makes perfect sense!

It's always nice to have an explanation of why faults appear to be intermittent.

Cheers.
 
Is there a benefit to using your method versus....
Code:
Call Shell("C:\BLAHBLAH\SOMEAPP.EXE", vbMinimizedNoFocus)
Which is how I always use the Shell function.
 
if you capture the return value you can check if the process is still running and wait for it or what ever...

Regards
 
namliam said:
if you capture the return value you can check if the process is still running and wait for it or what ever...

Regards
Thank you for the explaination.
 

Users who are viewing this thread

Back
Top Bottom