Click here to Skip to main content
15,892,005 members
Home / Discussions / COM
   

COM

 
GeneralRe: Embedding an ActiveX control in another Pin
TClarke31-Aug-06 1:05
TClarke31-Aug-06 1:05 
GeneralRe: Embedding an ActiveX control in another Pin
Roger Stoltz31-Aug-06 4:10
Roger Stoltz31-Aug-06 4:10 
Questionunregistering COM Pin
_tasleem29-Aug-06 3:05
_tasleem29-Aug-06 3:05 
AnswerRe: unregistering COM Pin
Steve S29-Aug-06 5:12
Steve S29-Aug-06 5:12 
QuestionPassing an Array of BSTR Pin
HakunaMatada28-Aug-06 20:51
HakunaMatada28-Aug-06 20:51 
AnswerRe: Passing an Array of BSTR Pin
Steve S29-Aug-06 2:39
Steve S29-Aug-06 2:39 
Questionnew vs CoCreateInstance Pin
_AnsHUMAN_ 28-Aug-06 0:10
_AnsHUMAN_ 28-Aug-06 0:10 
AnswerRe: new vs CoCreateInstance Pin
Steve S29-Aug-06 5:18
Steve S29-Aug-06 5:18 
One of the strengths of COM is that it is language-neutral, so a COM component can generally be used from any environment; 'new' is a C++ only thing, unless you're talking about the VB form,

set x = new object

which is, of course, a VB only thing.

By using 'new', you are creating an object instance on the local machine, whereas CoCreateInstance may (invisibly to you as a client) instantiate something remotely. Generally speaking, if you want an interface (which you should, since it provides a reference-counting mechanism, preventing you from using delete on an object which may have outstanding interface references) then use CoCreateInstance. If you need an object pointer, that isn't COM, it's C++. Of course, you may bend these rules slightly inside servers, since an interface method may create an object that it then hands back an interface to, but care should be taken with this to ensure that the normal COM rules are followed.

An interface is not a pointer to an object. It's an interface.

Steve S
Developer for hire

Questionautomatic call Pin
_tasleem27-Aug-06 22:04
_tasleem27-Aug-06 22:04 
AnswerRe: automatic call Pin
prasad_som27-Aug-06 23:19
prasad_som27-Aug-06 23:19 
QuestionThread in COM DLL Pin
rockryan27-Aug-06 3:03
rockryan27-Aug-06 3:03 
AnswerRe: Thread in COM DLL Pin
rockryan27-Aug-06 14:22
rockryan27-Aug-06 14:22 
QuestionIHTMLDocument2 get_applets Pin
nemo26-Aug-06 13:45
nemo26-Aug-06 13:45 
Question"Unadvising" Event sink in VB6 Pin
Ilia Blank25-Aug-06 7:45
Ilia Blank25-Aug-06 7:45 
GeneralRe: "Unadvising" Event sink in VB6 Pin
Guffa25-Aug-06 8:53
Guffa25-Aug-06 8:53 
QuestionDeriving multiple interfaces from base interface (aggregation) Pin
Andre xxxxxxx24-Aug-06 4:38
Andre xxxxxxx24-Aug-06 4:38 
AnswerRe: Deriving multiple interfaces from base interface (aggregation) Pin
Stephen Hewitt24-Aug-06 17:44
Stephen Hewitt24-Aug-06 17:44 
GeneralRe: Deriving multiple interfaces from base interface (aggregation) Pin
Andre xxxxxxx25-Aug-06 3:48
Andre xxxxxxx25-Aug-06 3:48 
GeneralRe: Deriving multiple interfaces from base interface (aggregation) Pin
Stephen Hewitt26-Aug-06 2:43
Stephen Hewitt26-Aug-06 2:43 
QuestionCalling a ATL COM DLL interface from VBScript routine Pin
AKSIVAKUMAR23-Aug-06 23:21
AKSIVAKUMAR23-Aug-06 23:21 
AnswerRe: Calling a ATL COM DLL interface from VBScript routine Pin
Andre xxxxxxx24-Aug-06 12:11
Andre xxxxxxx24-Aug-06 12:11 
GeneralRe: Calling a ATL COM DLL interface from VBScript routine Pin
AKSIVAKUMAR25-Aug-06 7:51
AKSIVAKUMAR25-Aug-06 7:51 
QuestionBest practice for strings Pin
Andre xxxxxxx23-Aug-06 9:47
Andre xxxxxxx23-Aug-06 9:47 
AnswerRe: Best practice for strings Pin
Mike Dimmick23-Aug-06 10:25
Mike Dimmick23-Aug-06 10:25 
GeneralRe: Best practice for strings Pin
Andre xxxxxxx23-Aug-06 11:02
Andre xxxxxxx23-Aug-06 11:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.