structures in external function calls

For questions and postings not covered by the other forums
ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

structures in external function calls

Postby ConvertFromOldNGs » Fri Aug 07, 2009 11:39 am

by Kern Carboni >> Wed, 13 Jan 1999 2:30:49 GMT

When calling an external windows function from jade which requires a C structure type as a parameter, what would be the jade equivalent of the
C structure?

Regards
Kern

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: structures in external function calls

Postby ConvertFromOldNGs » Fri Aug 07, 2009 11:39 am

by Craig Shearer >> Wed, 20 Jan 1999 23:22:41 GMT

Hi Kern

Well, JADE doesn't have an equivalent of a C Structure, but you can easily mock one up.

The Binary primitive type has a bufferAddress method which returns the address of its storage in memory, so you could create a binary large enough to hold the data then pass it to your Windows API function by getting its address.

While accessing the members of the structure is going to be a pain (you'd probably have to access each individual byte out of the binary to get the data you want), at least it is possible. You could always write a small DLL to take the binary and split it up into its component parts.

Give it a whirl, and let us know how it goes.

Craig.

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: structures in external function calls

Postby ConvertFromOldNGs » Fri Aug 07, 2009 11:39 am

by Roger Parkinson >> Mon, 22 Mar 1999 17:15:58 GMT

You almost certainly will find it easier to pass a list of parameters and pack them into the structure from the C code.

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: structures in external function calls

Postby ConvertFromOldNGs » Fri Aug 07, 2009 11:39 am

by Wilfred Verkley >> Tue, 23 Mar 1999 23:59:43 GMT
You almost certainly will find it easier to pass a list of parameters and pack them into the structure from the C code.

Wouldnt it be great if you could do that with kernel32.dll :-)

We often end up writing an OCX in VB that simplifies the interface between jade and any external components or code we need to call.


Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 14 guests

cron