Click here to Skip to main content
15,926,857 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
QuestionHow to check if the Flash player installed Pin
hell_admin13-Jul-06 20:58
hell_admin13-Jul-06 20:58 
AnswerRe: How to check if the Flash player installed Pin
sudeesh26-Jul-06 2:58
sudeesh26-Jul-06 2:58 
GeneralRe: How to check if the Flash player installed Pin
hell_admin26-Jul-06 3:14
hell_admin26-Jul-06 3:14 
QuestionCompiler error Pin
HarishDixit13-Jul-06 5:04
HarishDixit13-Jul-06 5:04 
AnswerRe: Compiler error Pin
Jörgen Sigvardsson16-Jul-06 21:59
Jörgen Sigvardsson16-Jul-06 21:59 
QuestionIXMLDOMDocument how to use Pin
shivditya13-Jul-06 2:35
shivditya13-Jul-06 2:35 
AnswerRe: IXMLDOMDocument how to use Pin
Steve S13-Jul-06 4:29
Steve S13-Jul-06 4:29 
QuestionWhy my ocx could not display in word? Pin
mrlhb12-Jul-06 3:39
mrlhb12-Jul-06 3:39 
AnswerRe: Why my ocx could not display in word? Pin
mrlhb15-Jul-06 16:46
mrlhb15-Jul-06 16:46 
QuestionAsp Pages on differnert resolution Pin
ayazsb12-Jul-06 1:40
ayazsb12-Jul-06 1:40 
AnswerRe: Asp Pages on differnert resolution Pin
Malli_S16-Jul-06 19:42
Malli_S16-Jul-06 19:42 
QuestionVC++ does not consider WTLs presence Pin
shivditya11-Jul-06 1:31
shivditya11-Jul-06 1:31 
AnswerRe: VC++ does not consider WTLs presence Pin
Monty211-Jul-06 2:13
Monty211-Jul-06 2:13 
AnswerRe: VC++ does not consider WTLs presence Pin
Steve Echols11-Jul-06 18:57
Steve Echols11-Jul-06 18:57 
GeneralRe: VC++ does not consider WTLs presence Pin
shivditya11-Jul-06 22:47
shivditya11-Jul-06 22:47 
QuestionThis problem is yet not solved ? Pin
shivditya11-Jul-06 23:50
shivditya11-Jul-06 23:50 
AnswerRe: This problem is yet not solved ? Pin
Steve S12-Jul-06 2:59
Steve S12-Jul-06 2:59 
QuestionRe: This problem is yet not solved ? Pin
shivditya12-Jul-06 19:39
shivditya12-Jul-06 19:39 
AnswerRe: This problem is yet not solved ? Pin
Steve S12-Jul-06 21:47
Steve S12-Jul-06 21:47 
AnswerRe: This problem is yet not solved ? Pin
Jörgen Sigvardsson16-Jul-06 1:45
Jörgen Sigvardsson16-Jul-06 1:45 
QuestionUrgent:memory leak in recursion with CComPtr Pin
rana7410-Jul-06 22:08
rana7410-Jul-06 22:08 
AnswerRe: Urgent:memory leak in recursion with CComPtr Pin
Stephen Hewitt11-Jul-06 1:19
Stephen Hewitt11-Jul-06 1:19 
Firstly if you use the "sp" prefix, which generally stands for "Smart Pointer", the variable in question should actually be a smart pointer. i.e.
CComPtr<IHTMLElement> spParentElem;

Don't write misleading code.

Make your code like this:
CComPtr<IHTMLElement> spParentElem;
while (1)
{
    CComBSTR bsTagName;
    spElem->get_tagName(&bsTagName);
    std::string thisods=ODSTag;
    ODSTag=OLE2A(bsTagName);
    if(thisods.size() > 0)
    {
       ODSTag+= ".";
       ODSTag+=thisods.c_str(); 
    }
 
    spParentElem.Release(); // FREE THE OLD ONE!
    hr = spElem->get_parentElement(&spParentElem);===>memory leaks here
    if (FAILED(hr) || !spParentElem)
    {
       break;
    }
    spElem.Detach()->Release();
    spElem=NULL;
    spElem = spParentElem;
}


The addition is shown in bold.

I'm going to finish with a bitch. We can't see any "<"s or ">"s or what's between them: this is important in C++ code. Also there is no formatting. Please make an effort to make things easier for the people who are taking time to help you. At the very least you could tick the "Ignore HTML tags in this message (good for code snippets)" check box.

Steve

PS: I can see iteration here but no recursion.
GeneralRe: Urgent:memory leak in recursion with CComPtr Pin
Monty211-Jul-06 2:15
Monty211-Jul-06 2:15 
GeneralRe: Urgent:memory leak in recursion with CComPtr Pin
Stephen Hewitt11-Jul-06 2:40
Stephen Hewitt11-Jul-06 2:40 
QuestionGet Frame window Handle Pin
HakunaMatada10-Jul-06 17:58
HakunaMatada10-Jul-06 17:58 

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.