Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 14th, 2006, 10:38 AM
Registered User
 
Join Date: Sep 2006
Location: Leiden, , Netherlands.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Tweety77
Default Connecting to an ActiveX exe

Current situation just after installing the components:

A ntservice executable (which runs in current user running space) connects to an activeX exe (using set object = new componentobject) and this works fine. component runs and does what it must do.

An other executable connects to the same activeX exe and also get the correct information from it.

Now it goes weird when I reboot the system and the ntservice program runs in the "system user" space. Its connect to the activeX exe and the component runs and does what it must do.

The problem arise at the moment a user startsup the normal executable. It connects to the activeX exe, but it cannot find it, starts another instance of it, so I have running 2 instances of the activeX exe, while in the first situation only 1 instance is running, which is the situation I like.

Does somebody have tips, or better, an example to retrieve the result that always just 1 instance of the activex exe is running, and not 2 or more??

All 3 execs are written in VB 6 and also have tried the createobject function in several ways to get result



Thnx in advantage
Reply With Quote
  #2 (permalink)  
Old September 14th, 2006, 12:15 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Alameda, ca, USA.
Posts: 627
Thanks: 0
Thanked 0 Times in 0 Posts
Default

did you try using GetObject instead of CreateObject?
what is the Instancing property of the ActiveX class you connect to?
I never tried to connect to the same ActiveX exe from different users...
Reply With Quote
  #3 (permalink)  
Old September 14th, 2006, 12:36 PM
Registered User
 
Join Date: Sep 2006
Location: Leiden, , Netherlands.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Tweety77
Default

Its not possible to connect to an activeX exe using GetObject, because the activeX exe is written in VB6 (why they don't support this is weird to me also). But neverteless, the hardhead i'm, i have try it also, with GetObject(,"Component.Class") and with GetObject("", "Component.Class"), but they both give errors, as documented in the MSDN (cannot find the class and can't create object).

I have 2 classes in the activeX, both are self created, a private class who actually does the functionality, and the other, public (multiuse) is just a connector to the functional class

Reply With Quote
  #4 (permalink)  
Old September 19th, 2006, 12:48 PM
Friend of Wrox
 
Join Date: May 2006
Location: San Diego, CA, USA.
Posts: 643
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You are correct in that you generally cannot use GetObject with an ActiveX component written in VB6.

This is because VB6 apps do not register themselves in the ROT (Running objects table).

You can use the API to do this... here is a link that has an example of code for this:

http://discuss.fogcreek.com/joelonso...w&ixPost=37504

I don't guarantee that this specific code will work, but I have done this in the past (about 5 years ago) and it worked for me.
If I find a better example or can find my old code, I will try to post it.

Woody Z http://www.learntoprogramnow.com
Reply With Quote
  #5 (permalink)  
Old September 19th, 2006, 01:21 PM
Friend of Wrox
 
Join Date: May 2006
Location: San Diego, CA, USA.
Posts: 643
Thanks: 0
Thanked 0 Times in 0 Posts
Default

One other thing: You mentioned the program is running under the system user permissions - that seems like it could be part of your problem. Sorry I missed that.

Woody Z http://www.learntoprogramnow.com
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ActiveX.exe to standard exe Kaustav VB How-To 6 February 24th, 2006 12:10 AM
Calling an ActiveX.EXE in C++ xgbnow Visual C++ 4 March 31st, 2004 08:12 AM
Calling an ActiveX.EXE in C++ xgbnow Pro VB 6 13 February 20th, 2004 12:31 PM
unregister activeX exe gbianchi Pro VB 6 2 February 10th, 2004 03:17 PM
ActiveX Exe and Dll Vasudevan VB How-To 1 September 26th, 2003 07:48 AM



All times are GMT -4. The time now is 07:00 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.