> I'm afraid don't understand the difference between your 2 CreateObject()
> calls Sascha. CreateObject will always return an object reference, and so
> must be stored in a object variable.
My fault, sorry.
Ok, I give it another try.
The class I try to create is called "SMC.SMCClient".
My client application has a reference to the SMC application, which is
the DCOM server app.
The first variant to instanciate the class is this:
dim objVar as object
set objVar = CreateObject("SMC.SMCClient","127.0.0.1")
The second variant is this:
dim smcVar as SMCClient
set smcVar = CreateObject("SMC.SMCClient","127.0.0.1")
The first variant (with objVar) works in any case. The second variant
works only if the smc application has been compiled.
Usually that is not a problem, but in my particular case I would like to
use the second variant, because I use 'withevents' to capture some
events raised by smcclient. To make debugging the smc application I
would also like to start the application in VB IDE. This worked before,
but obviously I made changes to either the client or the server
application that prevents setting smcVar to an instance von SMCClient.
I executed 'typename(CreateObject("SMC.SMCClient","127.0.0.1"))' while
the smc application was running in VB IDE and it returned 'SMCClient'.
Seemingly the instance returned by CreateObject and smcVar are the same,
but there must be some difference. I even cleaned the registry and
recompiled everything, but without success.
I hope that make my problem a little clearer...
Regards,
Sascha
Tony Proctor - 23 Sep 2004 13:18 GMT
This sounds like a mismatch in the GUIDs Sascha. In other words, the
registered version of SMC.SMCClient doesn't match the version being used
within your IDE. Are you running a "project group" containing the SMC
project, or is it in your Project References? What Compatibility setting are
you using?
Tony Proctor
> > I'm afraid don't understand the difference between your 2 CreateObject()
> > calls Sascha. CreateObject will always return an object reference, and so
[quoted text clipped - 35 lines]
> Regards,
> Sascha
Sascha Herpers - 23 Sep 2004 14:19 GMT
Hi,
> This sounds like a mismatch in the GUIDs Sascha. In other words, the
> registered version of SMC.SMCClient doesn't match the version being used
> within your IDE.
yes, I thought so too (even though this was just a guess, since I'm not
an expert for those things).
> Are you running a "project group" containing the SMC
> project, or is it in your Project References? What Compatibility setting are
> you using?
Client and Server are seperate project *not* running in a project group.
If I want them to run in parallel I fire up two instances of VB IDE.
The smc server application is a reference in the client project.
The compatibility of the server application is set to binaray compatibility.
[Unfortunatly I have to leave the office now, so I won't be able to read
your next post until tomorrow. Your question about the project group
gave me the idea to try to run the client and server within the same
IDE. Maybe that helps. I'll try that tomorrow too.]
Thanks so far...
Sascha
Sascha Herpers - 27 Sep 2004 06:23 GMT
Hi,
i got it.
during compilation of the server app I sometimes had trouble compiling
to exe, because vb said, the file was locked. Moving the binary
compatible version of the server app to another location solved the
compile problem.
But then I had the other problem described in my prior post.
The solution is: compile the exe and then copy the exe to the location
where the binary compatible version is. That's it.
I don't know why it's like that, but for some reason my client app looks
at the (outdated) binary compatible version instead of the registered
original server app, when I start client and server from vb ide. Maybe
vb ide always useses the typelib of the binary compatible version? I
don't know (even though that wouldn't sound too odd...).
Thanks Tony for your hints.
Regards,
Sascha