Solved

automation error while using activex dll

Posted on 2004-09-29
11
305 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
 
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

705 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now