Jump to content


Photo

Studio DLL GEX functions always return 0 or null


  • Please log in to reply
4 replies to this topic

#1 _257713

_257713

    GMC Member

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

Posted 10 July 2012 - 02:51 AM

I've been trying to create a GEX for a DLL to use in Studio.
I downloaded a zip that contained the source for the DLL and a .geb file. It's pretty old, so I don't know if that matters.

I compiled the source into a DLL using a Visual Studio. Then I used extension maker on the .geb that was included the zip file.

The functions I'm trying to use are written to never return zero, but when I run them in Game Maker Studio in Windows mode, they always return zero. Any idea why this would happen?

If I'm doing this all wrong, can someone point me to the directions / documentation for getting from .cpp and .h files to a working GEX in Game Maker Studio?

Here's the function declaration:
DLLEXPORT const char* mac_addrs() {

Here's the function in the extension.GMX file:
<function>
          <name>mac_addrs</name>
          <externalName></externalName>
          <kind>12</kind>
          <id>92</id>
          <help>mac_addrs()</help>
          <returnType>1</returnType>
          <argCount>0</argCount>
          <args/>
        </function>

  • 0

#2 _257713

_257713

    GMC Member

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

Posted 10 July 2012 - 02:54 AM

Also, I have been able to use the DLL in a java program using JNA, so I know the DLL is working correctly.
  • 0

#3 _257713

_257713

    GMC Member

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

Posted 10 July 2012 - 06:00 AM

I have also opened the project in Game Maker HTML5 1.0 and it accesses the DLL and gets the correct return values.
  • 0

#4 klek

klek

    GMC Member

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

Posted 14 July 2012 - 05:06 PM

You should report this bug http://bugs.yoyogames.com/

The last update of GM:Studio is being alot unestable with exentions
  • 0

MentorBanner1.png

Im open to help you in what i can.


#5 kevinleecarr

kevinleecarr

    GMC Member

  • New Member
  • 3 posts
  • Version:GM8

Posted 16 October 2012 - 06:30 AM

Found the issue. The gex was old and all the External Name fields were empty. I just set the External Name the same as the Name for all of the functions and now it works.
  • 0