VB Client creating many ActiveX EXE objects crashes 
Author Message
 VB Client creating many ActiveX EXE objects crashes


I would describe my application, and see if anyone can help me figure
out the problem. Everything is written in VB6 with Visual Studio SP3.
OS is Windows NT4 SP6.

1) I have a standard EXE which uses the NTSVC.OCX control...essentially
it's an NT service.
2) This client have a global object A (implemented in an ActiveX DLL)
which basically holds a collection of objects B (let's call this
collection CollObjB).
3) Class B is implemented in an ActiveX EXE, options are unattended
execution, thread-per-object.
4) A creates one object B (which will be kept it in a collection
later), and calls a method in B (let's call it B1). A reference of
object A is passed into method B1 where object B will hold it until
object B is destroyed. Method B1 will set a timer by calling SetTimer()
API. Thus B1 returns immediately to A.
5) The timer in object B awakes and call a private method in B. This
private method will create another in-proc COM object that updates a
database. On the completion of this private method, using the reference
to object A, B will call A.MethodCleanup() to remove the current object
B from the collection CollObjB.
6) As the call to MethodB1 is asynchronous, the client (NT Service)
will be causing object A to create many object B which runs
concurrently in a single ActiveX EXE process space...thus simulating a
sort of multithreading, but actually it's multiple STAs.

Now, for the problem i'm facing - the NT Service and the ActiveX EXE
will be running fine, but in unpredictable intervals, the ActiveX EXE
will cause a "DDE Error Window" to pop up complaining that an
instruction at a memory location could not be read. Worse, in a longer
interval (which is also unpredictable), a Dr.Watson may be generated by
the ActiveX EXE too.

I am just wondering if it is due to the passing of a reference of
object A to object B, thus not correctly marshalling the method calls
of the objects? I've build the application based on an article by R.
Mark Tucker in VB Programmer's Journal (can be found in
http://www.*-*-*.com/ ).

These crashes are making me thinking of going back to pure synchronous
calls, and in only one STA thread...any help or hints will be greatly


Sent via Deja.com http://www.*-*-*.com/
Before you buy.

Sat, 29 Mar 2003 11:50:23 GMT  
 [ 1 post ] 

 Relevant Pages 

1. ActiveX EXE server staying alive and sharing UNIQUE object for all clients

2. Client Server problem - ActiveX Can't create object

3. Permission denied when creating ActiveX EXE object

4. How to create a form in VB (with access db) and create an ActiveX Object

5. Why does VB crash when I rty to create a object to a COM interface

6. Urgent! ActiveX Control crashing Win98 clients

7. Urgent! ActiveX Control crashing Win98 clients

8. Make a VB ActiveX EXE as singleton object

9. Make a VB ActiveX EXE as singleton object

10. CreateObject in ActiveX EXE crashes app

11. ActiveX Exe crashes when shutdown.

12. Create EXE - crash


Powered by phpBB® Forum Software