codemorphis.com Forum Index codemorphis.com
Software development: pure and simple.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to setup structured arguments for DLL Function call.

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    codemorphis.com Forum Index -> Visual Programming Forum
View previous topic :: View next topic  
Author Message
rsiglin



Joined: 17 Apr 2006
Posts: 1

PostPosted: Mon Apr 17, 2006 6:31 pm    Post subject: How to setup structured arguments for DLL Function call. Reply with quote

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
View user's profile Send private message
CodeMorphis



Joined: 02 Dec 2003
Posts: 252

PostPosted: Mon Apr 17, 2006 11:30 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    codemorphis.com Forum Index -> Visual Programming Forum All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group