Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Apr 15th, 2005, 10:25 PM   #1
sham
Newbie
 
Join Date: Mar 2005
Posts: 29
Rep Power: 0 sham is on a distinguished road
I want to get reference to the activex object.Which method should I use GetObject or

I want to get reference to the activex object.Which method should I use GetObject or CreateObject?
sham is offline   Reply With Quote
Old Apr 16th, 2005, 10:00 AM   #2
Rory
Expert Programmer
 
Rory's Avatar
 
Join Date: Jan 2005
Location: London
Posts: 542
Rep Power: 4 Rory is on a distinguished road
Send a message via MSN to Rory
GetObject is when you want to get a handle to a single instance but multi-use (possibly MSTS) object, such as ActiveDirectory. e.g. GetObject("WinNT://mydomain/auser,user") returns an IADsUser object referencing a user in a domain, as opposed to creating a "user object" which is impossible.
CreateObject actually creates a new local copy of a multi-instance object such as the Windows Scripting Objects, as opposed to referencing an already existent object.
You should always aim to use the right method: some objects work with both, though not always.
Rory is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
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 On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 9:40 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC