Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 1,320 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
LucasJoshua, Baklazhan, Hanky27, firatv, wandaluciaia
19053 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Newbie question how call to win dll's #476380
02/21/19 18:39
02/21/19 18:39
Joined: Sep 2016
Posts: 1
M
mengnr Offline OP
Guest
mengnr  Offline OP
Guest
M

Joined: Sep 2016
Posts: 1
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

Re: Newbie question how call to win dll's [Re: mengnr] #476382
02/21/19 20:12
02/21/19 20:12
Joined: Apr 2008
Posts: 586
Austria
Petra Offline
Support
Petra  Offline
Support

Joined: Apr 2008
Posts: 586
Austria
You must call functions like DefineAPI inside the main function, not outside.


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1