Jump to content


Photo

Studio DLL error


  • Please log in to reply
6 replies to this topic

#1 the sivart

the sivart

    GMC Member

  • GMC Member
  • 145 posts
  • Version:GM:Studio

Posted 28 May 2012 - 05:21 PM

OK so I made a extension using extension maker a wile back and have been using it in game maker 8.1 with no problems. There are multiple DLL's in the .gex but its been working in 8.1 so I thought it would work in studio.

Now even with the new update, 2 of the DLL's will crash the game if I try and use them (in the windows runner) and a 3rd will load but will not act the way it is meant to.

So I would like to know if Studio is ever going to be able to use the same DLL's that GM8.1 can.
  • 0

#2 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • Global Moderators
  • 14395 posts
  • Version:GM:Studio

Posted 28 May 2012 - 05:36 PM

There is a problem with dll for studio needing dll_cdecl instead dll_stdcall (the reverse of what GM6,7,81 wanted) so I made a bug report. Meanwhile you can change the declaration in your GML for external define to use dll_cdecl instead of dll_stdcall
  • 0

#3 the sivart

the sivart

    GMC Member

  • GMC Member
  • 145 posts
  • Version:GM:Studio

Posted 28 May 2012 - 05:48 PM

Thanks a lot good sir :) only thing is I don't know that much on the coding end of the DLL. will using "dll_cdecl" instead of "dll_stdcall" break the DLL if it does not support it or is it just on the GM side?
  • 0

#4 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • Global Moderators
  • 14395 posts
  • Version:GM:Studio

Posted 28 May 2012 - 06:00 PM

Thanks a lot good sir :) only thing is I don't know that much on the coding end of the DLL. will using "dll_cdecl" instead of "dll_stdcall" break the DLL if it does not support it or is it just on the GM side?



The change is just needed on the GM side in the external_define call. I'm not sure what exactly the problem is but I'm hoping they will fix it so we wont need to re-code all our external declarations for our tool sets....
  • 0

#5 rwkay

rwkay

    YoYo Games CTO

  • YoYo Games Staff
  • 1415 posts
  • Version:Unknown

Posted 28 May 2012 - 07:14 PM

We have been looking at this today and as far as we can tell we are correctly handling both cdecl and stdcall DLL's, the issue appears to have been with earlier versions of GameMaker that were not handling it properly and when cdecl was being declared it was always using stdcall (or something like that) in any case we have tried both types of calls on the studio released today and it is working correctly (and cleaning up the stack correctly) for both types of calls.

One thing we will add though is a fallback to match previous behaviour so that if you declare it as cdecl and the function is not found we will test the stdcall equivalent and fall back to that, though we will emit a warning that the function is not what you thought it was.

Russell
  • 0

#6 the sivart

the sivart

    GMC Member

  • GMC Member
  • 145 posts
  • Version:GM:Studio

Posted 28 May 2012 - 07:24 PM

Thanks a lot! how soon will that update be out then? I am kinda stuck until then.
  • 0

#7 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • Global Moderators
  • 14395 posts
  • Version:GM:Studio

Posted 28 May 2012 - 09:19 PM

We have been looking at this today and as far as we can tell we are correctly handling both cdecl and stdcall DLL's, the issue appears to have been with earlier versions of GameMaker that were not handling it properly and when cdecl was being declared it was always using stdcall (or something like that) in any case we have tried both types of calls on the studio released today and it is working correctly (and cleaning up the stack correctly) for both types of calls.

Yeah, I thought there may be a problem with earlier version. I remember things not quite making sense the first dll I made...

One thing we will add though is a fallback to match previous behaviour so that if you declare it as cdecl and the function is not found we will test the stdcall equivalent and fall back to that, though we will emit a warning that the function is not what you thought it was.

Russell


We could not ask for anything more. Thanks! Hum. If I defined the API call with external_define as dll_stdcall (which we all did I believe) you will fall back to dll_cdcl upon failure and try again?
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users