typedef struct _SYSTEMTIME { WORD wYear ; WORD wMonth ; WORD wDayOfWeek ; WORD wDay ; WORD wHour ; WORD wMinute ; WORD wSecond ; WORD wMilliseconds ; } SYSTEMTIME DECLARE INTEGER GetSystemTime IN win32api STRING @ cBuff=SPACE(40) =GetSystemTime(@cBuff) tYear = ALLTRIM(STR(ASC(SUBSTR(cBuff,2)) * ; 256 + ASC(SUBSTR(cBuff,1)))) tMonth = ALLTRIM(STR(ASC(SUBSTR(cBuff,4)) * ; 256 + ASC(SUBSTR(cBuff,3)))) tDOW = ALLTRIM(STR(ASC(SUBSTR(cBuff,6)) * ; 256 + ASC(SUBSTR(cBuff,5))))Well. I'm a bit confused here how they got that cBuff has to be of size 40, when each word is only a size 2 and there is only 8 words, which I see as size 8*2 = 16. It says that you must create a 40-byte string buffer. Why?
typedef struct _INITDATA { DWORD dwSize; DWORD dwVersionMajor; DWORD dwVersionMinor; DWORD dwVersionBuild; DWORD dwOptions; DWORD dwReserved1; DWORD dwReserved2; char szDescription[MAXDESCRIPTIONLENGTH+1]; } INITDATA, FAR* LPINITDATA;All I need is to make sure that dwSize is the value of the size of the structure. Since it is a Double Word I would imagine the have size of 4 so I tried following (MAXDESCRIPTIONLENGTH is 128) strings
chr(157)+chr(0)+chr(0)+chr(0)+replicate(chr(0), 153) chr(0)+chr(157)+chr(0)+chr(0)+replicate(chr(0), 153) chr(0)+chr(0)+chr(157)+chr(0)+replicate(chr(0), 153) chr(0)+chr(0)+chr(0)+chr(157)+replicate(chr(0), 153)Or chr(156) and 152 replicated chr(0)'s or chr(32)'s.