Consultor Eletrônico



Kbase P13533: How to receive CHARACTER Value from a DLL API
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   31/01/2005
Status: Unverified

GOAL:

How to receive CHARACTER Value from a DLL API

FIX:

To return a character string from a shared library routine there are some times that a CHARACTER value does not work, so use OUTPUT parameter as MEMPTR as follow:

DEFINE VARIABLE ret AS MEMPTR.
DEFINE VARIABLE aux AS MEMPTR.

SET-SIZE(ret) = 8.

PROCEDURE ProcDll EXTERNAL "TestDll.dll" PERSISTENT:
DEFINE INPUT PARAMETER a1 AS CHAR.
DEFINE OUTPUT PARAMETER a2 AS MEMPTR.
END PROCEDURE.

RUN ProcDll (INPUT "xxxxxxxx" , OUTPUT ret).
SET-POINTER-VALUE(aux) = GET-LONG(ret,1).

MESSAGE
GET-STRING(aux,1)
VIEW-AS ALERT-BOX INFO BUTTONS OK.