Solved

VB EXE Run time error

Posted on 2004-09-27
5
1,188 Views
Last Modified: 2012-06-22
Hi there

I have a huge problem using VB5.

I am busy with a fairly large project. It has about 15 forms, 15 modules and a class module in the main app, as well as a timer.dll which I downloaded from the internet, and two activex.exe's which I wrote myself.

The one activex exe handles all communications with the comport and the other handles all database related issues.

I am writing in VB5, running on win2000.

The problem is quite strange. when I run the project in VB's design environment, it runs perfectly every time, and it has run perfectly every time for weeks. However, when I try to run a compiled version (on my own PC or others) it keeps failing with the error: Run time error -2147418107 (80010005) - Automation Error.

The strange thing is that it is not consistent. It fails about 8 or 9 times out of 10, but not always at the same place. I am pretty sure that its not my activex exes, because after the main app has crashed, they still appear to be running. It actually seems like the problem is when they label controls are being loaded on the forms.

The reason I suspect this is because sometimes it gives me the above error, but the the exe doesn't terminate. It then half loads up the form without the labels.

I thought that the problem was maybe with the PC, so I spent the whole weekend copying the code and pasting it to a new project on a different PC. Then I rebuilt all the forms and set their properties, but it still crashes all the time.

This is very frustrating. Does anyone know what is wrong?

PS, when I run a setup program on other PC's, I get the error: access is denied shdocvw.dll

Don't know if this has anything to do with it though because the compiled version won't even run on my PC.

Thank you

John Mc Murray
South Africa




0
Comment
Question by:JSMCM
5 Comments
 
LVL 5

Expert Comment

by:abith
ID: 12159877
hi

instead of using the package and deployment wizard.  trt of useing any other setup pakage and deployment wizard.  use software like setup generator.  becaseu in the setup generator you have to add the file manual.  

and i still i think this won't solve your problem.

Regards
Abith .K
0
 
LVL 2

Author Comment

by:JSMCM
ID: 12160765
Hi Guys.

Thanks, but I got some info on the internet for this problem. It is documented on Microsoft's site. When you have a timer in an application, and within that timer you call an out of process component, the timer ends up causing this error because the first call needs to first be released before the timer can call it again.

Microsofts work around is to use flags (Don't you just wish that instead of a work around they'd put a working, fixed copy of the controls on their site?)

Anyways, its working now. Very glad, 3 months of work has just been saved.

Here is the MS link.

http://support.microsoft.com/default.aspx?scid=kb;en-us;176399

John
0
 
LVL 85

Expert Comment

by:Mike Tomlinson
ID: 12161418
>> Don't you just wish that instead of a work around they'd put a working, fixed copy of the controls on their site?

That is not a problem with the control, it is a problem in the way the control is used by the user.

Another alternative to flags, is to disable the timer upon entry, do your code and then enable the timer again:

    Private Sub Timer1_Timer()
        Timer1.Enabled = False
   
        ' Do something...
   
        Timer1.Enabled = True
   End Sub

~IM
0
 

Accepted Solution

by:
ee_ai_construct earned 0 total points
ID: 12222332
Question answered by asker or dialog valuable.
Closed, 300 points refunded.
ee_ai_construct (replacement part #xm34)
Community Support Admin
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
substring method in java 1 116
lucky13 challenge 11 142
seriesUp challenge 7 153
wordcount challenge 11 121
How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question