Click here to Skip to main content
15,906,106 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralRe: How to convert *string to _bstr_t and *BSTR Pin
Zac Howland2-Aug-06 4:22
Zac Howland2-Aug-06 4:22 
AnswerRe: How to convert *string to _bstr_t and *BSTR Pin
Michael Dunn28-Jul-06 6:22
sitebuilderMichael Dunn28-Jul-06 6:22 
QuestionReturning Class Pointer From ATL component.. [modified] Pin
Mahesh Kulkarni24-Jul-06 2:29
Mahesh Kulkarni24-Jul-06 2:29 
AnswerRe: Returning Class Pointer From ATL component. Pin
Stephen Hewitt24-Jul-06 23:50
Stephen Hewitt24-Jul-06 23:50 
GeneralRe: Returning Class Pointer From ATL component. Pin
Mahesh Kulkarni25-Jul-06 18:41
Mahesh Kulkarni25-Jul-06 18:41 
GeneralRe: Returning Class Pointer From ATL component. Pin
Justin Tay25-Jul-06 20:52
Justin Tay25-Jul-06 20:52 
GeneralRe: Returning Class Pointer From ATL component. Pin
Stephen Hewitt26-Jul-06 0:40
Stephen Hewitt26-Jul-06 0:40 
GeneralRe: Returning Class Pointer From ATL component. Pin
Steve S25-Jul-06 22:03
Steve S25-Jul-06 22:03 
No you don't. A COM interface should provide all the functionality, which may well include accessors for properties.
If you start handing out raw C++ class pointers, it is no longer COM, no longer marshallable, remotable, or usable by anything other than a VC++ client, and possibly not even that if you later switch to a different version of VC++.

An interface is not a class. A class may implement one or more interfaces (typically IUnknown, sometimes IDispatch, and one or more interfaces derived from them), but an interface is not a pointer to an object, nor should it be treated as one. This means no access via an interface to member data, and no casting the interface to something else directly.

You need to read (or re-read) Don Box's "Essential COM", plus there is an MSDN article which essentially describes the process of going from a C++ class to COM interfaces in design terms (here[^])

Steve S
Developer for hire

QuestionHow the component knows it has been Advise for connection from Client? Pin
Amar Sutar24-Jul-06 0:39
Amar Sutar24-Jul-06 0:39 
AnswerRe: How the component knows it has been Advise for connection from Client? Pin
Steve S25-Jul-06 22:08
Steve S25-Jul-06 22:08 
GeneralRe: How the component knows it has been Advise for connection from Client? Pin
sudeesh26-Jul-06 2:53
sudeesh26-Jul-06 2:53 
Questioninterview questions on ATL COM Pin
pathakr21-Jul-06 3:49
pathakr21-Jul-06 3:49 
QuestionHope this works ! Pin
nvatia21-Jul-06 3:41
nvatia21-Jul-06 3:41 
AnswerRe: Hope this works ! Pin
Stephen Hewitt21-Jul-06 4:04
Stephen Hewitt21-Jul-06 4:04 
GeneralRe: Hope this works ! Pin
nvatia21-Jul-06 4:12
nvatia21-Jul-06 4:12 
AnswerRe: Hope this works ! Pin
Stephen Hewitt21-Jul-06 4:18
Stephen Hewitt21-Jul-06 4:18 
GeneralRe: Hope this works ! Pin
nvatia21-Jul-06 5:14
nvatia21-Jul-06 5:14 
GeneralRe: Hope this works ! Pin
Stephen Hewitt21-Jul-06 18:12
Stephen Hewitt21-Jul-06 18:12 
GeneralRe: Hope this works ! [modified] Pin
Zac Howland25-Jul-06 5:57
Zac Howland25-Jul-06 5:57 
GeneralRe: Hope this works ! Pin
Stephen Hewitt26-Jul-06 2:09
Stephen Hewitt26-Jul-06 2:09 
GeneralRe: Hope this works ! Pin
Zac Howland26-Jul-06 3:41
Zac Howland26-Jul-06 3:41 
QuestionTemplates compile error - errata 2 Pin
nvatia21-Jul-06 3:29
nvatia21-Jul-06 3:29 
AnswerRe: Templates compile error - errata 2 Pin
toxcct25-Jul-06 21:24
toxcct25-Jul-06 21:24 
QuestionTemplate compile error - errata Pin
nvatia21-Jul-06 3:26
nvatia21-Jul-06 3:26 
AnswerRe: Template compile error - errata Pin
prasad_som21-Jul-06 3:37
prasad_som21-Jul-06 3:37 

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.