OK I will do your job and ask a proper question (you should do it by yourself if you want a chance to have answers...).
Correct me if I am wrong. Your
FireMTURL
function looks like:
CString FireMTURL(CString msisdn, CString mesg, CString MT_URL, CString MT_SHORTCODE)
{
}
You are telling that your application crashes and restarts as soon as it tries to enter that function. Since you put lots of logs inside it, you should see the logs written, but there are none. So your function is not called.
If all this is correct, then I suppose there is a problem in the arguments:
1 - First of all, don't pass
CString
to your function, pass
CString&
instead. This will avoid calling copy-constructor.
2 - Before calling the function, check that all your
CString
parameters are valid. If one of them is corrupted, then the function call would probably crash due to the call of the copy-constructor.
3 - If one of the
CString
is corrupted, it is most likely that you accessed its internal data using the
GetBuffer
or
GetBufferSetLength
methods without calling
ReleaseBuffer
or
ReleaseBufferSetLength
after modification.
To use references, change your function declaration to:
CString FireMTURL(CString& msisdn, CString& mesg, CString& MT_URL, CString& MT_SHORTCODE)
{
}
To call that function, you can use your previous code without changing anything more:
resp = FireMTURL(DB_DATA.msisdn, msg_send, minsat.MT_URL, MT_SHORTCODE);