Please login or register.

Login with username, password and session length
Advanced search  

News:

This forum provides RSS feed. To query recent posts use this url. More...


Author Topic: Calling Windows API function  (Read 3633 times)

0 Members and 1 Guest are viewing this topic.

McCoy

  • The cocido eater
  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 365
  • Spurrrrrrring
    • View Profile
    • Spur Games
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 Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
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. ::wave

McCoy

  • The cocido eater
  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 365
  • Spurrrrrrring
    • View Profile
    • Spur Games
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... :P
Logged

Click here to sign my sig!

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
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. ::wave
 

Page created in 0.038 seconds with 19 queries.