Click here to Skip to main content
15,913,685 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
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 
AnswerRe: Get Frame window Handle Pin
Arman S.11-Jul-06 3:01
Arman S.11-Jul-06 3:01 
GeneralRe: Get Frame window Handle Pin
HakunaMatada11-Jul-06 3:25
HakunaMatada11-Jul-06 3:25 
GeneralRe: Get Frame window Handle Pin
Arman S.11-Jul-06 3:57
Arman S.11-Jul-06 3:57 
QuestionHow do I do this ? [modified] Pin
Smith#10-Jul-06 2:49
Smith#10-Jul-06 2:49 
AnswerRe: How do I do this ? Pin
Kurt _B12-Jul-06 5:42
Kurt _B12-Jul-06 5:42 
AnswerRe: How do I do this ? Pin
Pharago16-Jul-06 0:29
Pharago16-Jul-06 0:29 
QuestionHow to create dropdown style button using TBSTYLE_DROPDOWN Pin
shivditya10-Jul-06 1:48
shivditya10-Jul-06 1:48 
QuestionWhat Design Pattern does ATL/COM is based upon Pin
Balkrishna Talele10-Jul-06 1:40
Balkrishna Talele10-Jul-06 1:40 
AnswerRe: What Design Pattern does ATL/COM is based upon Pin
shivditya10-Jul-06 2:06
shivditya10-Jul-06 2:06 
AnswerRe: What Design Pattern does ATL/COM is based upon Pin
ThatsAlok10-Jul-06 23:25
ThatsAlok10-Jul-06 23:25 
QuestionMemory leak in CComVariant changetype Pin
rana749-Jul-06 20:59
rana749-Jul-06 20:59 
QuestionGraceful thread exit Pin
rana746-Jul-06 21:03
rana746-Jul-06 21:03 
AnswerRe: Graceful thread exit Pin
Arman S.11-Jul-06 3:08
Arman S.11-Jul-06 3:08 
QuestionHTTP Auth Intercept/Password Form Processing using IE Pin
harningt6-Jul-06 7:26
harningt6-Jul-06 7:26 

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.