Okay I ma getting close. Using the first piece of advice I received from hilfy I was able to get the call to the DLL to work.
function utlapi(var func:LongInt; DataString:string; var Length, RetC, Xtra1, Xtra2:LongInt):LongInt; stdcall; external 'PCSUTL32.DLL';
This is my call to the DLL. This DLL is called by many different processes and it reacts differently based on primarily the first variable which defines which internal function will be called. The DLL is expecting a string for the 2nd parameter.
function utl_GetString(intRow:integer; intColumn:integer; strGetString:string; intStringLength:integer):LongInt;
begin
HllFunctionNo := UA_GET_STRING; {235}
HllData := StringOfChar(' ', 8000);
HllLength := intStringLength;
HllReturnCode := 0;
HllParm5 := intRow;
HllParm6 := intColumn;
lngTempRC := utlapi(HllFunctionNo, HllData, HllLength, HllReturnCode, HllParm5, HllParm6);
strGetString := MidStr(HllData, 1, intStringLength);
utl_GetString := HllReturnCode;
end;
The above code actually works and returns the values I expect into strGetString. I use this DLL in basic which defaults to passing parameters by reference rather than by value and thus the string I receive in strGetString never gets back to the calling function. I would think that it would be simple then to declare the strGetString parameter as var so its value is returned to the calling code but it doesn't work then?
I am confused????