Hi everybody,
Here is a simple code I am trying to get work:
But the SystemTimeToFileTime function gives me an error message: 'The parameter is incorrect'.
Can anyone tell me what is wrong with the code?
I am using Borland C++ Builder-3.
Thanks,
Alex
Here is a simple code I am trying to get work:
Code:
int main()
{
SYSTEMTIME st = {2000,10,15,0,0,0,0,0};
FILETIME ft;
int intRet;
LPVOID lpMsgBuf;
char chrMsg[256];
intRet = SystemTimeToFileTime(&st,&ft);
FormatMessage
(
FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
NULL,
GetLastError(),
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
(LPTSTR) &lpMsgBuf,
0,
NULL
);
sprintf(chrMsg, "%s\n", lpMsgBuf);
return 0;
}//int main()
But the SystemTimeToFileTime function gives me an error message: 'The parameter is incorrect'.
Can anyone tell me what is wrong with the code?
I am using Borland C++ Builder-3.
Thanks,
Alex