Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by howardR. 04/24/24 20:04
M1 Oversampling
by Petra. 04/24/24 10:34
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Data from CSV not parsed correctly
by EternallyCurious. 04/20/24 21:39
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
folder management functions
by VoroneTZ. 04/17/24 06:52
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (Ayumi, AndrewAMD), 770 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 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