Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

automation error while using activex dll

Posted on 2004-09-29
11
310 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
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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 process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

809 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