Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
C++ help
Message
From
14/08/1997 20:45:27
 
 
To
13/08/1997 11:52:14
Edward Crawford
City Facilities Management
Glasgow, United Kingdom
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Title:
Miscellaneous
Thread ID:
00044460
Message ID:
00044823
Views:
27
Please save the following code as C file, it works. Use with VFP declare integer ConvertTime IN timeconv.dll String @Buffer Buffer = space(64) ? ConvertTime(@Buffer) ? Buffer #define STRICT #include #include BOOL WINAPI DllMain(HANDLE hInst, ULONG ulReason, LPVOID pReserved) { switch (ulReason) { case DLL_PROCESS_ATTACH: break; case DLL_PROCESS_DETACH: break; default: break; } return (TRUE); } int WINAPI ConvertTime(LPSTR pBuffer) { int iResult = -1; struct tm *newtime; time_t aclock; aclock = time(NULL); // 8067157205 is invalid, localtime() returns NULL pointer if (pBuffer && (newtime = localtime(&aclock))) { lstrcpy(pBuffer, asctime(newtime)); iResult = lstrlen(pBuffer); } return (iResult); } Winfried
Previous
Reply
Map
View

Click here to load this message in the networking platform