Hi folks Is this prob weird or whatThis is my get todays date routine
Does what it says on the tin
wchar_t *ReturnTodaysDateString()
{
SYSTEMTIME st;
GetSystemTime(&st);
wchar_t *xstr=L"";
wchar_t daystr[10];
wchar_t mnthstr[10];
wchar_t yrstr[10];
if (st.wDay<10)
swprintf(daystr, L"0%d/",st.wDay);
else
swprintf(daystr, L"%d/",st.wDay);
if (st.wMonth<10)
swprintf(mnthstr, L"0%d/",st.wMonth);
else
swprintf(mnthstr, L"%d/",st.wMonth);
swprintf(yrstr, L"%d",st.wYear);
wcscpy(xstr,daystr);
wcscat(xstr,mnthstr);
wcscat(xstr,yrstr);
return xstr;
}
This is a sip delete button
handler used it for years no problem
// It is my own alphanumertic sip ( slightly larger than the one that the pda uses by default)
// Handle Delete____________________________________________________________
// g_editfocus is the edit control i am deleteing in
if(idctrltapped==IDC_DELKEY)
{
SendMessage(GetDlgItem(h, g_editfocus),EM_GETSEL ,(WPARAM)&start,(LPARAM)&end);
if (end>start && end!=0)
SendMessage(GetDlgItem(h, g_editfocus),EM_REPLACESEL ,(WPARAM)TRUE,PARAM)L"");
if (end==start && end!=0)
{
SendMessage(GetDlgItem(h, g_editfocus),EM_SETSEL ,(WPARAM)start-1,(LPARAM)end);
SendMessage(GetDlgItem(h, g_editfocus),EM_REPLACESEL ,(WPARAM)TRUE,(LPARAM)L"");
}
SetFocus(GetDlgItem(h, g_editfocus));
return 0;
}
Now for the problem
No matter what dialog i am using or what control every time i tap delete instead of deleteing a character it prints the date into the edit box
??
Del key works fine until i call the date function
I have never been able to get _wcsdate(wchar_t * dst) to work always get unresolved externals error
i have tried setting todays datestr to both global and local variables and still same problem
Any help woul be appreciated