September 01, 2024, 03:35:37 AM
Welcome,
Guest
Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Forum rules
-
please read before posting, it can save you a lot of time.
Home
Help
Search
Calendar
Login
Register
Wintermute Engine Forum
>
Wintermute Engine
>
Technical forum
>
Topic:
Calling Windows API function
« previous
next »
Pages: [
1
]
Print
Author
Topic: Calling Windows API function (Read 3683 times)
0 Members and 1 Guest are viewing this topic.
McCoy
The cocido eater
Frequent poster
Karma: 0
Offline
Gender:
Posts: 365
Spurrrrrrring
Calling Windows API function
«
on:
July 13, 2003, 11:48:23 AM »
It's possible in WME to call Windows API functions? If it's possible, how? Like calling an external DLL? Please, Jan, put an example with CreateFile and WriteFile if it's possible...
Logged
Click
here
to sign my sig!
Mnemonic
WME developer
Administrator
Addicted to WME forum
Karma: 41
Offline
Gender:
Posts: 5683
Re:Calling Windows API function
«
Reply #1 on:
July 13, 2003, 12:24:58 PM »
Yes, calling Windows API functions is essentially the same as calling any other DLL function. But the Windows file functions are rather complex to be called directly from a script. I'd recommend writing your own simple DLL to encapsulate the API calls (or even better to use some high-level C functions, such as fopen a fwrite).
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum.
McCoy
The cocido eater
Frequent poster
Karma: 0
Offline
Gender:
Posts: 365
Spurrrrrrring
Re:Calling Windows API function
«
Reply #2 on:
July 13, 2003, 12:32:02 PM »
Well, I asked that because I didn't wanted to do a DLL if I can call directly the API Functions... But if it's that hard, I'll make a DLL using IOstreams... I hope...
Logged
Click
here
to sign my sig!
Mnemonic
WME developer
Administrator
Addicted to WME forum
Karma: 41
Offline
Gender:
Posts: 5683
Re:Calling Windows API function
«
Reply #3 on:
July 13, 2003, 12:37:35 PM »
Ok, I'm not saying it's impossible. You'd have to find out the actual values for all the constants used in CreateFile and pass them from WME script as numbers. Another problem is that the WriteFile function takes a DWORD pointer as a parametr, but WME script doesn't allow you to use pointers. You'd have to fake it using a string variable.
Well, it's way to messy for my taste...
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum.
Print
Pages: [
1
]
« previous
next »
Wintermute Engine Forum
>
Wintermute Engine
>
Technical forum
>
Topic:
Calling Windows API function