Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old April 15th, 2006, 07:03 PM
LozWare's Avatar
LozWare LozWare is offline
Contributing User
ASP Free Novice (500 - 999 posts)
 
Join Date: Jun 2005
Posts: 531 LozWare User rank is Sergeant Major (2000 - 5000 Reputation Level)LozWare User rank is Sergeant Major (2000 - 5000 Reputation Level)LozWare User rank is Sergeant Major (2000 - 5000 Reputation Level)LozWare User rank is Sergeant Major (2000 - 5000 Reputation Level)LozWare User rank is Sergeant Major (2000 - 5000 Reputation Level)LozWare User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 4 Days 10 h 56 m 31 sec
Reputation Power: 46
Send a message via MSN to LozWare
Muliple Instances of the Same ActiveX Class

Hi Guys (mainly Doug!),

How do I make a program load multiple instances of the same ActiveX class. I have the following code:
Code:
Set Tester(1) = Nothing
Set Tester(1) = CreateObject("Example.TestClass")

Set Tester(2) = Nothing
Set Tester(2) = CreateObject("Example.TestClass")

But both Tester(1) and Tester(2) are just loading the same control, so techncially speaking, Tester(1) and Tester(2) are just mirrors of one another.

I want to know how to load 2 independent ActiveX controlls. I thought the code wwould be the following, but it does not work:
Code:
Set Tester(1) = Nothing
Set Tester(1) = New CreateObject("Example.TestClass")

Set Tester(2) = Nothing
Set Tester(2) = New CreateObject("Example.TestClass")


Any Ideas? Because the above code wont work. To be a bit more clear, I am using ActiveX EXEs, and with the code I am uisng at the momney, only 1 process is loaded, and Tester(1) and Tester(2) are simple controlling the same process. What I want to hapeen is for 2 seperate processes to be loaded.
__________________
LozWare Website Directory

Whooo! Free submissions, no recip needed. I'm a nice guy

Last edited by LozWare : April 15th, 2006 at 07:06 PM.

Reply With Quote
  #2  
Old April 15th, 2006, 08:07 PM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 23 h 29 m 58 sec
Reputation Power: 181
From your code tester(1) and tester(2) are either an array, or a control array, in either case the variables are independent of one another.

Your object may prevent multiple instances. Otherwise try using ByVal somewhere (but I don't know where)
__________________
======
Doug G
======
I didn't attend the funeral, but I sent a nice letter saying I approved of it. --Mark Twain

Reply With Quote
  #3  
Old April 16th, 2006, 02:13 AM
LozWare's Avatar
LozWare LozWare is offline
Contributing User
ASP Free Novice (500 - 999 posts)
 
Join Date: Jun 2005
Posts: 531 LozWare User rank is Sergeant Major (2000 - 5000 Reputation Level)LozWare User rank is Sergeant Major (2000 - 5000 Reputation Level)LozWare User rank is Sergeant Major (2000 - 5000 Reputation Level)LozWare User rank is Sergeant Major (2000 - 5000 Reputation Level)LozWare User rank is Sergeant Major (2000 - 5000 Reputation Level)LozWare User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 4 Days 10 h 56 m 31 sec
Reputation Power: 46
Send a message via MSN to LozWare
Thanks Doug, I have found the problem, but I dont know how to overcome it. The controls are still indipendant from one another - but at the same time they are not! Only 1 process is loaded - and I have a form on the ActiveX EXE, and only 1 of them is loaded too.

However, the actaul class is loaded multiple times - so techncially it is working.

BUT this is not what I want. I want a completely seperate process to be loaded each time a new class is created.

Reply With Quote
  #4  
Old April 16th, 2006, 03:08 AM
LozWare's Avatar
LozWare LozWare is offline
Contributing User
ASP Free Novice (500 - 999 posts)
 
Join Date: Jun 2005
Posts: 531 LozWare User rank is Sergeant Major (2000 - 5000 Reputation Level)LozWare User rank is Sergeant Major (2000 - 5000 Reputation Level)LozWare User rank is Sergeant Major (2000 - 5000 Reputation Level)LozWare User rank is Sergeant Major (2000 - 5000 Reputation Level)LozWare User rank is Sergeant Major (2000 - 5000 Reputation Level)LozWare User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 4 Days 10 h 56 m 31 sec
Reputation Power: 46
Send a message via MSN to LozWare
Dont Worry, I have found a little work around.

I have turned the ActiveX EXEs into StandAlone EXEs, and I have turned the Standalone EXE (the one that was originally loading the ActiveX EXEs) into an ActiveX EXE.

Its just like a Database relationship really...

Many-to-one
Standalone-to-ActiveX

lol

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > Muliple Instances of the Same ActiveX Class


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT