Re: TreeView Control question
- From: "chenzero" <nowhere@xxxxxxxxxxxxxxx>
- Date: Wed, 18 May 2005 19:57:05 +0800
Thanks, Martin, and I had better study c from the beginning again :)
> The problem ist you have a temporal string, that gets destroyed driectly
> after this statement. The description says to c_str "The return value
> is valid only as long as the string exists" and "The return value is
> owned by the string".
>
> So rewrite the code in this way:
>
> string myStr = mame();
> insertData.item.pszText = const_cast<char*>(myStr.c_str());
>
> HTH
>
> --
> Martin Richter [MVP] WWJD
> "In C we had to code our own bugs. In C++ we can inherit them."
> FAQ : http://www.mpdvc.de
> Samples: http://www.codeguru.com http://www.codeproject.com
.
- References:
- TreeView Control question
- From: chenzero
- Re: TreeView Control question
- From: Martin Richter [MVP]
- TreeView Control question
- Prev by Date: Re: Strange behavior!
- Next by Date: Re: How can I set the position of Explorer-style 'Open/Save as' di
- Previous by thread: Re: TreeView Control question
- Next by thread: Strange behavior!
- Index(es):
Relevant Pages
|