CString pointers
-
I need to pass dereference a pointer so that I can obtain a CString. It seems to crash on the second function call. I think I'm not handling the deletion of the pointer correctly? What do you think? Thanks! CString new_date; BOOL new_date; new_date = IsDate("4/5/07", &new_date); int CDateTime::IsDate(CString datestr, CString * new_date_format) { CString month; CString day; CString year; /* parse datestr */ CString revised_str = month + "/" + day + "/" + year; *new_date_format = revised_str; }
-
I need to pass dereference a pointer so that I can obtain a CString. It seems to crash on the second function call. I think I'm not handling the deletion of the pointer correctly? What do you think? Thanks! CString new_date; BOOL new_date; new_date = IsDate("4/5/07", &new_date); int CDateTime::IsDate(CString datestr, CString * new_date_format) { CString month; CString day; CString year; /* parse datestr */ CString revised_str = month + "/" + day + "/" + year; *new_date_format = revised_str; }
You have two variables called
new_date
- typo?--Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ VB > soccer
-
You have two variables called
new_date
- typo?--Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ VB > soccer
Yes. I meant to name it differently.
-
I need to pass dereference a pointer so that I can obtain a CString. It seems to crash on the second function call. I think I'm not handling the deletion of the pointer correctly? What do you think? Thanks! CString new_date; BOOL new_date; new_date = IsDate("4/5/07", &new_date); int CDateTime::IsDate(CString datestr, CString * new_date_format) { CString month; CString day; CString year; /* parse datestr */ CString revised_str = month + "/" + day + "/" + year; *new_date_format = revised_str; }
-
I need to pass dereference a pointer so that I can obtain a CString. It seems to crash on the second function call. I think I'm not handling the deletion of the pointer correctly? What do you think? Thanks! CString new_date; BOOL new_date; new_date = IsDate("4/5/07", &new_date); int CDateTime::IsDate(CString datestr, CString * new_date_format) { CString month; CString day; CString year; /* parse datestr */ CString revised_str = month + "/" + day + "/" + year; *new_date_format = revised_str; }
-
I need to pass dereference a pointer so that I can obtain a CString. It seems to crash on the second function call. I think I'm not handling the deletion of the pointer correctly? What do you think? Thanks! CString new_date; BOOL new_date; new_date = IsDate("4/5/07", &new_date); int CDateTime::IsDate(CString datestr, CString * new_date_format) { CString month; CString day; CString year; /* parse datestr */ CString revised_str = month + "/" + day + "/" + year; *new_date_format = revised_str; }
elephantstar wrote:
CString new_date; BOOL new_date; new_date
Is this compile successfully.. i doubt
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief and You