Click here to Skip to main content
15,887,267 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
QuestionWindows Vista not allowed to write file on C:\Users folder Pin
am 20091-Jun-10 3:50
am 20091-Jun-10 3:50 
AnswerRe: Windows Vista not allowed to write file on C:\Users folder Pin
Randor 1-Jun-10 8:38
professional Randor 1-Jun-10 8:38 
GeneralRe: Windows Vista not allowed to write file on C:\Users folder Pin
am 20092-Jun-10 4:27
am 20092-Jun-10 4:27 
QuestionRe: Windows Vista not allowed to write file on C:\Users folder Pin
Randor 2-Jun-10 7:46
professional Randor 2-Jun-10 7:46 
AnswerRe: Windows Vista not allowed to write file on C:\Users folder Pin
am 20093-Jun-10 4:21
am 20093-Jun-10 4:21 
QuestionProblem with Activex control property pages Pin
Sreenivas00328-May-10 2:17
Sreenivas00328-May-10 2:17 
QuestionAbout the remove() behavior of container list on MAC [modified] Pin
szh12113-May-10 15:47
szh12113-May-10 15:47 
AnswerRe: About the remove() behavior of container list on MAC Pin
szh12113-May-10 22:55
szh12113-May-10 22:55 
I think i have got the reason, let's see the source code on Windows from MS vc++.

void remove(const _Ty& _Val_arg)
{ // erase each element matching _Val
/* Dinkumware makes a copy of _Val_arg in case it's removed along the way, i.e.
* when the user pass an element of the list as _Val_arg.
*
* We believe that the signature of std::list::remove should be changed
* from remove(const _Ty&) to remove(_Ty) to explicitly indicate that a copy is involved.
*/
const _Ty _Val = _Val_arg; // in case it's removed along the way
iterator _Last = end();
for (iterator _First = begin(); _First != _Last; )
if (*_First == _Val)
_First = erase(_First);
else
++_First;
}

Please pay attention to statement "const _Ty _Val = _Val_arg;" ant its comment.
The problem i faced is, the argument that passed into list::remove() is the object from list.
That means on MAC, the statement "_M_erase(__first);" would destroy the object __first pointing to, unfortunately, __first is pointing to __value.
Therefore, after "_M_erase(__first);", the __value is destroyed. Make a copy to be the argument to remove items from list is the solution.
QuestionChild windows of non-modal dialog not receiving WM_DESTROY (at least not when expected) Pin
mjxy9-May-10 4:49
mjxy9-May-10 4:49 
QuestionHowto put a TrackBar in a Menu ? Pin
yarp27-Apr-10 1:07
yarp27-Apr-10 1:07 
QuestionCreating a borderless MDI child window Pin
Member 381982124-Apr-10 0:00
Member 381982124-Apr-10 0:00 
AnswerRe: Creating a borderless MDI child window Pin
Jonathan Davies24-Apr-10 1:06
Jonathan Davies24-Apr-10 1:06 
QuestionProblems while adding custom header with IWebBrowser2 [modified] Pin
arbittorr21-Apr-10 12:14
arbittorr21-Apr-10 12:14 
AnswerRe: Problems while adding custom header with IWebBrowser2 Pin
Stephen Hewitt22-Apr-10 14:09
Stephen Hewitt22-Apr-10 14:09 
GeneralRe: Problems while adding custom header with IWebBrowser2 Pin
arbittorr23-Apr-10 0:18
arbittorr23-Apr-10 0:18 
GeneralRe: Problems while adding custom header with IWebBrowser2 Pin
Jonathan Davies23-Apr-10 1:57
Jonathan Davies23-Apr-10 1:57 
GeneralRe: Problems while adding custom header with IWebBrowser2 Pin
arbittorr23-Apr-10 22:01
arbittorr23-Apr-10 22:01 
GeneralRe: Problems while adding custom header with IWebBrowser2 Pin
Jonathan Davies24-Apr-10 1:26
Jonathan Davies24-Apr-10 1:26 
QuestionIs it possible to make an activex by WTL Pin
Shuang. Wu15-Apr-10 20:31
Shuang. Wu15-Apr-10 20:31 
AnswerRe: Is it possible to make an activex by WTL Pin
Jonathan Davies15-Apr-10 23:47
Jonathan Davies15-Apr-10 23:47 
GeneralRe: Is it possible to make an activex by WTL Pin
Shuang. Wu16-Apr-10 0:20
Shuang. Wu16-Apr-10 0:20 
GeneralRe: Is it possible to make an activex by WTL Pin
Jonathan Davies16-Apr-10 0:40
Jonathan Davies16-Apr-10 0:40 
AnswerRe: Is it possible to make an activex by WTL Pin
«_Superman_»16-Apr-10 8:02
professional«_Superman_»16-Apr-10 8:02 
GeneralRe: Is it possible to make an activex by WTL Pin
Shuang. Wu18-Apr-10 6:00
Shuang. Wu18-Apr-10 6:00 
GeneralRe: Is it possible to make an activex by WTL Pin
Jonathan Davies24-Apr-10 1:33
Jonathan Davies24-Apr-10 1:33 

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.