| || |
SQABasic: Unable to retrieve complete record by calling function of DLL
We are calling a function of DLL (built to access third party control) from SQABasic code. The call to function passes a record, part of which will be filled up by DLL. After the call, the attempt to extract value of one of the fields from Record is incomplete, meaning only one character is retrieved instead of complete word/string.
Structure defined in DLL:-
#define STRMAX 256
// filled by function in the DLL
Corresponding Record defined in SQABasic:-
hWnd as Long
iControlIdx as Long
fReturn as Single
‘complete value is not copied
lpstr as string*256
ErrorMsg as string
Code to call function from DLL:-
Dim TParam as HarnessParam_record
Result = SendHarnessMessage(TParam)
The value returned by TParam.lpstr is a single character (e.g. “U”) instead of complete string/word (e.g. “USA”).
Using CopyMemory to copy TParam record to a variant or string did not help either.
Can you suggest any other alternatives?
Re: SQABasic: Unable to retrieve complete record by calling function of DLL
Pl. Check the declaration 'lpstr as string*256 '. Confirm if SQABasic supports this