Solved

automation error while using activex dll

Posted on 2004-09-29
11
311 Views
Last Modified: 2008-01-09
Hi, i have written a VB active x dll.
the method that i´m calling from asp looks like this one
Public Function getDate(ByVal path As String)
    Set proxy = CreateObject("comproxy.comproxy") 'my own comproxy needed to use my own com components
    Set Obj = proxy.CreateObject("mytools.myfile") 'my own component
    flag = Obj.Open(path)
    getDate = Obj.cipDate
    flag = Obj.Close()
   
    Set Obj = Nothing
    Set proxy = Nothing
end function
the project name is tools, the class name is tdate

that means, in ASP i´m creating
Set myObject = Server.create("tools.tdate")
this works fine, but after some hours the server says:

myObj Fehler "80010108'
Automatisierungsfehler Das aufgerufene Objekt wurde von den Clients getrennt.
/xxxx/xxx.asp, line 157

in english:
Automation Error "80010108'
The object invoked has disconnected from its clients

the comproxy is not thread safe so it can only be called one time, is that the problem?
but thats why i´m doing Set proxy = Nothing
PLS help me :-)

0
Comment
Question by:Koma666
11 Comments
 
LVL 3

Expert Comment

by:sgayatri
ID: 12188213
Your code is not easily understandable.
Why that createobject twice?
May be if you can give the code of your activex dll also (if not entire, atleast the procedure-wise breakup) ,
problem can be looked into...
0
 
LVL 5

Author Comment

by:Koma666
ID: 12188248
i have my own com infrastructure because the microsoft com dosn´t work under unix
so i have my comproxy which is used to call my own com objects and the comproxy is a real microsoft com object

Set proxy = CreateObject("comproxy.comproxy")

thats why i use my proxy object to create the other objects
mytools.myfile is not a real com object so it has to be created over the proxy object
Set Obj = proxy.CreateObject("mytools.myfile")

but thats not the problem, that works fine.

the problem is, that there can be only one instance of the proxy object running.
so i have to set it to nothing or save it to the Application like

if Application("proxyobject") is nothing then
    Set proxy = CreateObject("comproxy.comproxy")
    set Application("proxyobject") = proxy
end if

set proxy = Application("proxyobject")

but if i do this i get the apartment model error.
and if i set the proxy to nothing i get the Automation Error "80010108'
after some hours.
0
 
LVL 7

Expert Comment

by:_agj_
ID: 12188975
there must be some connection timeout property for this component.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 5

Author Comment

by:Koma666
ID: 12189065
the component only reads a crypted file and extracts a date.
This is very fast, i don´t think it´s a timeout problem.
but i´ll check it.
0
 
LVL 7

Expert Comment

by:_agj_
ID: 12189129
do u need to ..say, call Proxy.Close() before u set it to nothing?

This is slightly a different situation, but possibly we can get something from it...
as in, there used to be this app using a treeview control which would get this error if i did something like hide the control...etc...
Basically, some operation that u do which makes the server disc.

why do u say "after a few hours"?
does this happen randomly....or would u get it in the 2nd try or something?

now i dont think a timeout could be the reason....
0
 
LVL 7

Expert Comment

by:_agj_
ID: 12189143
find out which statement this error occurs in the dll code...

adding some default error handlers would be enough...
0
 
LVL 5

Author Comment

by:Koma666
ID: 12189233
i don´t have to call a close function, i handle all of that in the proxy itself.

i don´t get any errors from the proxy.
I have error handling in it.
But no error is thrown.

when i run this functions local and open 1000 proxies
call 1000 times the cipdate
then everything works fine.
but on the iis i get this error *grrrrr*
0
 
LVL 5

Author Comment

by:Koma666
ID: 12562968
Solved the problem myself.
It was a multithreading error.
The error only occurs if two or more calls to the dll are made at the same time.
Added some singletons and now it works.
0
 

Accepted Solution

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

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

685 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