Forums | Forums |




Hello, I am trying to get the current date in the form of a string, but IDATECTL_GetDateString() corrupts my julian struct and AECHAR[].

GETJULIANDATE(dwsecs, &jt);
IDATECTL_SetDate(pMe->pIDate, jt.wYear, jt.wMonth, jt.wDay);

int retSize =0;
memset(pMe->textBuf, '\0', 12*sizeof(AECHAR));
bool crap = IDATECTL_GetDateString(pMe->pIDate, pMe->textBuf, 12*sizeof(AECHAR), &retSize, DFMT_DD_MON_YYYY);

After this function call, the julian struct (jt) gets filled with garbage data, pMe->textBuf is NULL, retSize is either garbage (or 2009?) and IDATECTL_GetDateString() returns false. The julian struct is just fine with proper values until after I call IDATECTL_GetDateString().

For whatever reason, this function works *sometimes* when I step through the debugger slowly, which leads me to believe that I am overwriting memory somewhere, but that's the best guess I've got :( Any idea what's wrong?

Thank you.


Update: Umm.....nevermind? It works now, I have no idea why or how.