Jose's Read Only Forum 2023

Purebasic-Tipps and Code => Purebasic Tipps => Topic started by: Israel Vega on May 21, 2015, 08:31:43 PM

Title: Execute a function of PowerBASIC from PureBASIC
Post by: Israel Vega on May 21, 2015, 08:31:43 PM
PowerBasic code of DLL:

#COMPILE DLL

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


PureBasic code with String function reading how UNICODE:

  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...