Unhandled Exception errror in CStringData GetData()
-
In my function, Im assignning one Global CString to varaible declared in header file.But it shows unhandled exception error. My code
CString sReceiceStr = _T(""); //Global variable
void CChatServerDlg::AddMsg( userinfo \*udata, CString sIP) { sReceiceStr.Format("%s : %s : %s : %s : %s",udata->cSessionID ,udata->cTraineeName, udata->cPassword, udata->cClientServerMsg, udata->cInsName); sTempassign = sReceiceStr; //sTempassign is declared in Headerfile of this dlg class
It shows error in the above line. It shows error in CStringData GetData() function Kindly help me.
Anu
-
In my function, Im assignning one Global CString to varaible declared in header file.But it shows unhandled exception error. My code
CString sReceiceStr = _T(""); //Global variable
void CChatServerDlg::AddMsg( userinfo \*udata, CString sIP) { sReceiceStr.Format("%s : %s : %s : %s : %s",udata->cSessionID ,udata->cTraineeName, udata->cPassword, udata->cClientServerMsg, udata->cInsName); sTempassign = sReceiceStr; //sTempassign is declared in Headerfile of this dlg class
It shows error in the above line. It shows error in CStringData GetData() function Kindly help me.
Anu
Runtime exception or compile error? You could try to use the
_T
macro for the format string -_T("%s : %s : %s : %s : %s")
«_Superman_» _I love work. It gives me something to do between weekends.
-
Runtime exception or compile error? You could try to use the
_T
macro for the format string -_T("%s : %s : %s : %s : %s")
«_Superman_» _I love work. It gives me something to do between weekends.
-
Run Time error only. But when i cahnge the calling method og AddMsg,no error is coming. May be it smy mistake.Now its working.
Anu
have you check the string formation of variable after string.format ? try using watch
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
Never mind - my own stupidity is the source of every "problem" - Mixturecheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You
-
In my function, Im assignning one Global CString to varaible declared in header file.But it shows unhandled exception error. My code
CString sReceiceStr = _T(""); //Global variable
void CChatServerDlg::AddMsg( userinfo \*udata, CString sIP) { sReceiceStr.Format("%s : %s : %s : %s : %s",udata->cSessionID ,udata->cTraineeName, udata->cPassword, udata->cClientServerMsg, udata->cInsName); sTempassign = sReceiceStr; //sTempassign is declared in Headerfile of this dlg class
It shows error in the above line. It shows error in CStringData GetData() function Kindly help me.
Anu
Is
udata
non-NULL
? Have you stepped intoFormat()
to see what throws the exception?"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous