How Can find a exist running ActiveX server 
Author Message
 How Can find a exist running ActiveX server

An ActiveX server is running, how can I get the punk from it by not create a
new instant of it? the following function  does not work.
  hr = GetActiveObject(CLSID_MyServer, NULL, (IUnknown FAR* FAR*)&punk);

Can any one know how to?

River



Fri, 14 May 2004 00:44:19 GMT  
 How Can find a exist running ActiveX server
Assuming that the Ax Server is a VB server (otherwise why post to a VB
group?), the reason
would be that VB objects do not get placed in the RunningObjectTable (ROT)

Look up the Singleton pattern here for one technique that may be used
http://www.insteptech.com/OOPatterns.htm
--
Chris Anderson
(aka Merak on VISBAS-L)


Quote:
> An ActiveX server is running, how can I get the punk from it by not create
a
> new instant of it? the following function  does not work.
>   hr = GetActiveObject(CLSID_MyServer, NULL, (IUnknown FAR* FAR*)&punk);

> Can any one know how to?

> River



Fri, 14 May 2004 05:49:43 GMT  
 How Can find a exist running ActiveX server


Quote:
> Assuming that the Ax Server is a VB server (otherwise why post to a VB
> group?), the reason
> would be that VB objects do not get placed in the RunningObjectTable (ROT)

> Look up the Singleton pattern here for one technique that may be used
> http://www.insteptech.com/OOPatterns.htm

The technique discussed in the article doesn't quite work.  It makes a
singleton per thread, since module-levels are placed in TLS (thread local
storage). (You should use a single-threaded component to make it work -
which is what I do)
To provide a true singleton in VB6, you're forced to use the ROT (running
object table).  This is more tricky, because it requires a very good
understanding of what you're doing.  The technique is explained very well in
Matthew Curland's book "Advanced Visual Basic 6" (and the title is very apt)
www.powervb.com .

Van den Driessche Willy
For a work in progress :
http://users.skynet.be/wvdd2/index.html>



Fri, 14 May 2004 08:21:32 GMT  
 How Can find a exist running ActiveX server
Willy Van den Driessche seems to be right.I have already used the skill introduced in article " the Singleton pattern here for one technique that may be used http://www.insteptech.com/OOPatterns.htm", but it not works.

Thanks

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Sat, 15 May 2004 01:19:54 GMT  
 How Can find a exist running ActiveX server
Can Willy Van den Driessche discuss more? I have no the book.

thanks

River



Quote:

> The technique discussed in the article doesn't quite work.  It makes a
> singleton per thread, since module-levels are placed in TLS (thread local
> storage). (You should use a single-threaded component to make it work -
> which is what I do)
> To provide a true singleton in VB6, you're forced to use the ROT (running
> object table).  This is more tricky, because it requires a very good
> understanding of what you're doing.  The technique is explained very well
in
> Matthew Curland's book "Advanced Visual Basic 6" (and the title is very
apt)
> www.powervb.com .

> Van den Driessche Willy
> For a work in progress :
> http://users.skynet.be/wvdd2/index.html>



Sat, 15 May 2004 01:21:39 GMT  
 How Can find a exist running ActiveX server
I guess I'm going to have to disappoint some of you.  My best suggestion is
really to buy the book.  It's not that expensive and it comes with some
superb tools : a typelibrary editor, a tool that fixes OCA problems, an
addin to let you generate console applications in VB.  As the real bonus you
need, there is a very lightweight library that implements the ROTHook for
you.  All work has already been done.
The author once helped me with a {*filter*} OCA problem and as kind of a tribute
I recommend the book.  Don't get me wrong.  I would never recommend anybody
to buy it if it was a lousy piece of work.  But this is a book written by
somebody who combines rare qualities : knowing how to write and
understanding what he's writing about.

--
Van den Driessche Willy
For a work in progress :
http://www.*-*-*.com/



Sat, 15 May 2004 04:41:33 GMT  
 How Can find a exist running ActiveX server


Quote:
> > Look up the Singleton pattern here for one technique that may be used
> > http://www.insteptech.com/OOPatterns.htm

> The technique discussed in the article doesn't quite work.  It makes a
> singleton per thread, since module-levels are placed in TLS (thread local
> storage). (You should use a single-threaded component to make it work -
> which is what I do)
> To provide a true singleton in VB6, you're forced to use the ROT (running
> object table).  This is more tricky, because it requires a very good
> understanding of what you're doing.  The technique is explained very well
in
> Matthew Curland's book "Advanced Visual Basic 6" (and the title is very
apt)
> www.powervb.com .

Good point Willy, because I have only used this technique in Single Threaded
components I fogot about that requirement.  Thanks for reminding me

And I must also recommend Matt Curlands book..a book that's worth
many more times what you pay for it !!

Getting objects in the ROT is one of *many* advanced techniques, and it
doesn't just stop at giving you the code, and a short rundown of the
technique
but explains everything you need to know to understand and tweak the code
if your requirements are not quite met

I for one, do not add code to my apps that I do not understand, and that
I've
just downloaded or copied from a book "because it works".  Understanding
how the code works is paramount IMHO, and this book allows for this

Merak



Sun, 16 May 2004 07:50:14 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. How do I find out if a file exists on the server side

2. WithEvents and Run-time error 462: The remote server machine does not exists or is unavailable

3. Run-time error '462': The remote server machine does not exist or is unavailable

4. WithEvents and Run-time error 462: The remote server machine does not exists or is unavailable

5. Error 462: Remote server machine does not exist, etc when running distributed COM

6. How to find out an activex exe method is running

7. Can't find Printers when running ASP using ActiveX Word application component

8. Registering ActiveX server - have VB6 Prof but can't find clireg32.exe

9. I find a goog ftp server ocx (activeX)

10. New ActiveX ctl to extend existing ActiveX Ctl

11. API to Find Login Server While Running Logon.bat

12. Activex Document exe running on client not server.

 

 
Powered by phpBB® Forum Software