|
-
Apr 21st, 2004, 04:00 PM
#1
Thread Starter
Lively Member
Automation Error
Hi, in the following code, I get the error "Automation Error" when the execution reaches the line Set objInterface...
Code:
Private Sub Command1_Click()
Dim objInterface As Object
Dim objServer As Object
On Error GoTo cuError
Set objInterface = CreateObject("Intrf.Interface_Server")
Set objServer = objInterface.objGetClassInstance("Class1")
MsgBox objServer.showWindow
Set objInterface = Nothing
Set objServer = Nothing
On Error GoTo 0
Exit Sub
cuError:
MsgBox Err.Description
Set objInterface = Nothing
Set objServer = Nothing
Exit Sub
End Sub
Object Intrf is installed on a server on the network. What are possible reasons for that error?
Thanks in advance
-
Apr 21st, 2004, 05:27 PM
#2
Fanatic Member
can you provide the precise error message (with error code)?
"Knowledge is gained when different people look at the same information in different ways"
- Louis Pasteur
-
Apr 22nd, 2004, 06:51 AM
#3
Thread Starter
Lively Member
Err.Number -2147221231
Err.Description Error de Automatización (spanish)
Automation error (English)
Thanks in advance!
-
Apr 22nd, 2004, 08:25 AM
#4
Fanatic Member
Wish I could help you more but I am not an expert when it comes to the COM stuff....(still learning myself!)....I noticed that no one else replied and was kind of hoping some of our resident OO pros might jump in....all I know at this point is for some reason (and I hope this does not insult your intelligence - just trying to offer any kernel of info you might find useful) the object fails instantiation as the error is occuring at this time (Set statement). And becuase it is being accessed across a network, a likely assumption is that the call to it can't find it for some reason. Reasons may have to do with the GUID or the way it was registered perhaps....but again, I am swimming in murky waters in terms of my own experience. Sorry I could not be more helpful. Best of luck with it.
"Knowledge is gained when different people look at the same information in different ways"
- Louis Pasteur
-
Apr 22nd, 2004, 08:38 AM
#5
Thread Starter
Lively Member
Thanks for your answer ahara, it seems to be like you explain. But the problem is how to determine which is the problem, so I hope somebody could help with his own experience, or giving to me some alternatives to try in order to troubleshoot this problem.
Could somebody please help me with this?
-
Apr 22nd, 2004, 08:48 AM
#6
Addicted Member
Are you testing this under the IDE or have you compiled it already?
If you are doing this under the IDE then you need to open the server application (the one you called in the createObject function) under another instance of the VB IDE. Once you do this ensure that start mode for the server application is set to ActiveX Component and that in the debug tab that you have it set for "Wait until called" or something like this. Then run click the run program button and the app should just sit there. Now return to your client application (the one doing the calling) and attempt to run it once again.
If you have already compiled the server application ensure that you have properly registered the application
-
Apr 22nd, 2004, 09:22 AM
#7
Thread Starter
Lively Member
I have it compiled, I'm not testing it under IDE. So, what do you mean by "ensure that you have properly registered the application"?
-
Apr 22nd, 2004, 09:44 AM
#8
Addicted Member
When you are dealing with ActiveX Components (dll or exe) you must register them with the operating system.
From your run menu you need to enter:
RegSrv32 and then the path where the file is located.
I also just noticed that the server app is located on a remote computer so you will also need to generate a type library and register that on the client computer.
I'm not real great on remote automation stuff so I'm going to leave it at that I'm sure someone with a little more exp can help you from this point on.
-
Apr 22nd, 2004, 09:48 AM
#9
Thread Starter
Lively Member
Ok, thanks JRSofty for your collaboration. I feel we are getting closer to the solution.
Server application is located in a remote computer, so I need some help on how to make my client application create the object in the server. Somebody please?
-
Apr 22nd, 2004, 10:55 AM
#10
Fanatic Member
I'm with JMuller and would like to know the answer - if anyone out there has experience with COM....we need to know how to register a remote component on the network. How do we generate a type library that can be registered on the client computer? Thanks in advance.
"Knowledge is gained when different people look at the same information in different ways"
- Louis Pasteur
-
Apr 23rd, 2004, 06:08 AM
#11
Thread Starter
Lively Member
Please... could anybody help me with this? Thanks!
-
Aug 16th, 2004, 03:57 AM
#12
Fanatic Member
Same error number different thread.
There is no answer is the short answer.
http://www.vbforums.com/showthread.p...16#post1763116
Google has no idea: http://www.google.com/search?q=Error...&start=10&sa=N
Experts exchange is silent: http://www.experts-exchange.com/Data..._21036797.html
and all I know is that it effects some Access 2000 to 2003 crossover and MS-Exchange.
It seems to be a wider MS-Issue but as to what I have no idea.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|