[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

automation error while using activex dll

Posted on 2004-09-29
11
Medium Priority
?
315 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
[X]
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
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
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!

 
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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
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…
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…
Suggested Courses

656 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