Posted By: mengnr
Newbie question how call to win dll's - 02/21/19 18:39
I want to get the current system time, however, I can't figure out the correct to call DLL routines. Advice/pointer to examples very much appreciated. I currently have this:
//#include <litec.h>
//#include <windows.h>
//long __stdcall MessageBox(HWND,char *,char *,long);
//MessageBox = DefineApi("user32!MessageBox");
typedef struct SYSTEMTIME {
WORD wYear;
WORD wMonth;
WORD wDayOfWeek;
WORD wDay;
WORD wHour;
WORD wMinute;
WORD wSecond;
WORD wMilliseconds;
} SYSTEMTIME;
void __stdcall GetSystemTime(long *);
GetSystemTime = DefineApi("kernal32!GetSystemTime");
void main()
{
printf("nStart");
SYSTEMTIME tm;
long *ptm = &tm;
GetSystemTime(tm);
printf("nDonenn");
}
Many thanks, Martin
//#include <litec.h>
//#include <windows.h>
//long __stdcall MessageBox(HWND,char *,char *,long);
//MessageBox = DefineApi("user32!MessageBox");
typedef struct SYSTEMTIME {
WORD wYear;
WORD wMonth;
WORD wDayOfWeek;
WORD wDay;
WORD wHour;
WORD wMinute;
WORD wSecond;
WORD wMilliseconds;
} SYSTEMTIME;
void __stdcall GetSystemTime(long *);
GetSystemTime = DefineApi("kernal32!GetSystemTime");
void main()
{
printf("nStart");
SYSTEMTIME tm;
long *ptm = &tm;
GetSystemTime(tm);
printf("nDonenn");
}
Many thanks, Martin