View previous topic :: View next topic |
Author |
Message |
rsiglin
Joined: 17 Apr 2006 Posts: 1
|
Posted: Mon Apr 17, 2006 6:31 pm Post subject: How to setup structured arguments for DLL Function call. |
|
|
I'm trying to interface with a DLL that has several arguments, but one is setup in the following STRUCTURE:
DWORD Size of Structure
DWORD Machine name (i.e. 1234)
DWORD Constant 0
LPTSRT IP Address (i.e. 192.168.200.210)
DWORD Listener Port Number (i.e. 47809)
(This DLL is an API that interfaces with a fingerprint reader.) How would this be coded in Synopsis "function parameter declaration"? Remember this is just one parameter with several other regular single arguments for this specific function call. The actual DLL function syntax is:
int STA_Initialize (LPCSTR lpsqAppName, LPSTA_DEVICE lpDevice, LPHSTA lpHSTA);
The first argument (lpsqAppName) is a pointer to the application name.
The second argument (lpDevice) is the pointer to the above device STRUCTURE.
The third argument (lpHSTA) is a pointer to a subsystem instance used on all subequent function calls.
Can this call be handled by Synopsis?
Thanks,
Rich |
|
Back to top |
|
|
CodeMorphis
Joined: 02 Dec 2003 Posts: 252
|
Posted: Mon Apr 17, 2006 11:30 pm Post subject: |
|
|
Rich,
The advanced feature of passing arbitrary structures is not available in Synopsis 1.1. Because this requires dynamically building structure arrangements at run-time and then passing them through the machine's call stack there is some "magic" that needs to be performed. This mechanism has the added complexity that different compilers (that generate the DLLs) can store the structures slightly differently, which is sufficient to cause function call errors. However, we will try to add such handling for structures in the future.
If possible, you could create function call wrappers that allow for the structure members to be passed as function call parameters. Sorry if this does not currently meet your immediate needs. |
|
Back to top |
|
|
|