Click here to Skip to main content
16,007,760 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralRe: ATL 7.0 Creating Clients for COM Components Pin
Jörgen Sigvardsson16-Dec-02 10:44
Jörgen Sigvardsson16-Dec-02 10:44 
GeneralChild Dialog and the XP visual styles Pin
Chad Busche13-Dec-02 11:32
Chad Busche13-Dec-02 11:32 
GeneralWTL Community Pin
Michael P Butler13-Dec-02 2:07
Michael P Butler13-Dec-02 2:07 
GeneralRe: WTL Community Pin
Paul Selormey13-Dec-02 2:24
Paul Selormey13-Dec-02 2:24 
GeneralRe: WTL Community Pin
Ramon Casellas13-Dec-02 2:54
Ramon Casellas13-Dec-02 2:54 
GeneralRe: WTL Community Pin
AlexO19-Dec-02 5:08
AlexO19-Dec-02 5:08 
GeneralUsing CComPtr<IHTMLDocument2Ptr>? (first time in ATL...) Pin
Joan M13-Dec-02 0:10
professionalJoan M13-Dec-02 0:10 
GeneralRe: Using CComPtr? (first time in ATL...) Pin
Paul M Watt13-Dec-02 5:20
mentorPaul M Watt13-Dec-02 5:20 
First, click the "Display this message as-is (no HTML)" in order to make sure that all of your < and > tags appear in your code.

Next it looks like you are declaring your smart pointers like this:
CComPtr<IHTMLDocument2Ptr> spHTMLDocPtr;
CComPtr<IDispatchPtr> spIDispatchPtr;


When you declare a smart pointer with CComPtr you only need to define the type, you don't need to define it as a pointer. So change your code to this:
CComPtr<IHTMLDocument2> spHTMLDocPtr;
CComPtr<IDispatch> spIDispatchPtr;


I believe this will fix your problem.

When ever these items are assigned, Addref is automatically called on your interfaces, and when the smart pointer goes out of scope, the reference is Released. If you would like to get a hold of a pointer without AddRef or Release being called, use Attach adn Detach respectively.

Good Luck



Build a man a fire, and he will be warm for a day
Light a man on fire, and he will be warm for the rest of his life!

GeneralRe: Using CComPtr? (first time in ATL...) Pin
Joan M13-Dec-02 5:37
professionalJoan M13-Dec-02 5:37 
GeneralRe: Using CComPtr? (first time in ATL...) Pin
AlexO19-Dec-02 3:23
AlexO19-Dec-02 3:23 
GeneralRe: Using CComPtr? (first time in ATL...) Pin
Joan M19-Dec-02 3:44
professionalJoan M19-Dec-02 3:44 
Generallist of VARIANT Pin
bojinyu12-Dec-02 2:31
bojinyu12-Dec-02 2:31 
GeneralRe: list of VARIANT Pin
Daniel Strigl12-Dec-02 2:49
Daniel Strigl12-Dec-02 2:49 
GeneralRe: list of VARIANT Pin
bojinyu12-Dec-02 3:22
bojinyu12-Dec-02 3:22 
GeneralRe: list of VARIANT Pin
Daniel Strigl12-Dec-02 4:30
Daniel Strigl12-Dec-02 4:30 
GeneralRe: list of VARIANT Pin
bojinyu12-Dec-02 18:07
bojinyu12-Dec-02 18:07 
GeneralRe: list of VARIANT Pin
bojinyu12-Dec-02 3:22
bojinyu12-Dec-02 3:22 
QuestionSTL Tree ? Pin
Nick Parker11-Dec-02 7:28
protectorNick Parker11-Dec-02 7:28 
AnswerRe: STL Tree ? Pin
Neville Franks11-Dec-02 9:25
Neville Franks11-Dec-02 9:25 
GeneralRe: STL Tree ? Pin
Nick Parker11-Dec-02 9:37
protectorNick Parker11-Dec-02 9:37 
GeneralRe: STL Tree ? Pin
Todd Smith12-Dec-02 11:36
Todd Smith12-Dec-02 11:36 
AnswerRe: STL Tree ? Pin
Paul M Watt13-Dec-02 5:26
mentorPaul M Watt13-Dec-02 5:26 
AnswerRe: STL Tree ? Pin
Jörgen Sigvardsson14-Dec-02 10:57
Jörgen Sigvardsson14-Dec-02 10:57 
QuestionHow do I raise events. Pin
acosmin11-Dec-02 3:15
acosmin11-Dec-02 3:15 
AnswerRe: How do I raise events. Pin
xi90412-Dec-02 2:07
xi90412-Dec-02 2:07 

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.