Solved

automation error while using activex dll

Posted on 2004-09-29
11
309 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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Opening Remote & Local Data Connection 2 57
VB6 code to programmatically convert pdf to excel 21 85
Saving history changes to sub form 4 42
vb6 connector to mongodb 2 80
There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

813 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

18 Experts available now in Live!

Get 1:1 Help Now