Can someone explain to me what the difference between these 2 bits of code are? I thought they would essentially do the same thing... I don't understand why when I call some dll's either works fine. And other dll's only work using the M$ALLOC method. There must be something different about these that I don't understand OR maybe I'm completely off my rocker here and have no idea whatsoever :-)
Assume you have some dll with the function "SetData"
CALL "M$ALLOC" USING 20, PTR.
CALL "M$PUT" USING PTR, "Hello World".
IF IS-REMOTE
CALL "@[DISPLAY]:SetData" USING 20, BY VALUE PTR.
ELSE
CALL "SetData" USING 20, BY VALUE PTR
END-IF.
CALL "M$FREE" USING PTR.
IF IS-REMOTE
CALL "@[DISPLAY]:SetData" USING 20, BY REFERENCE "Hello World".
ELSE
CALL "SetData" USING 20, BY REFERENCE "Hello World"
END-IF.
Of course I woud much rather use the code without M$ALLOC as I cannot get it to work in a thin client to unix environment. the memory is allocated on the server and doesn't not properly pass thru to the @[DISPLAY]:SetData...