Author Topic: Execute a function of PowerBASIC from PureBASIC  (Read 2262 times)

0 Members and 1 Guest are viewing this topic.

Offline Israel Vega

  • Newbie
  • *
  • Posts: 22
  • User-Rate: +0/-0
Execute a function of PowerBASIC from PureBASIC
« on: May 21, 2015, 08:31:43 PM »
PowerBasic code of DLL:
Code: [Select]
#COMPILE DLL

FUNCTION MENSAJE() EXPORT AS WSTRING
  FUNCTION="Hola Israel"
END FUNCTION
                         

PureBasic code with String function reading how UNICODE:
Code: [Select]
  If OpenLibrary(0, "C:\PBWIN10\PRUEBAS\PRUEBAPB.dll")
    A$ = PeekS(CallFunction(0, "MENSAJE"),#PB_Unicode)
    MessageRequester("RESULTADO",A$,0)
    CloseLibrary(0)
  EndIf

For return a LONG change to PeekL instead of PeekS...also PeekF for float,  PeekQ for Quad...


« Last Edit: May 21, 2015, 09:08:57 PM by Israel Vega »