Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
API functions with structures
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00842537
Message ID:
00842632
Views:
29
This message has been marked as the solution to the initial question of the thread.
Hi Yiorgos.

You did not indicate what members this structure consists of.
Let, for example, define it as follows:
typedef struct _STRUCTDEV {
  DWORD iType;
  WORD wPort;
  CHAR strSerialNo[11];
} STRUCTDEV;
An equivalent FoxPro code should be something like this:
#DEFINE SDTYPE_SERIAL 0x0001

DECLARE INTEGER FSL_SelectDevice IN <dll name>;
	STRING @dev, STRING param2

LOCAL cBuffer, nType, nPort, cSerial
nType = SDTYPE_SERIAL
nPort = 1
cSerial = "ABC02000001"

cBuffer = PADR(Chr(nType), 4, Chr(0)) +;
	PADR(Chr(nPort), 2, Chr(0)) +;
	cSerial

nResult = FSL_SelectDevice(@cBuffer, "any string")
If the structure has different definition than you have to make corresponding changes in the way you populate cBuffer.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform