Jump to content

Recommended Posts

Posted

void yintomid(
    char *in,
    char *mid,
    char *out);

How do I call this function from within AutoIt?This func. is present in a dll..I can't figure out how to define a char ptr with DllStructCreate..And I'm running blind..here..pls help

Quote

Together we might liveDivided we must fall

 

Posted

The function is supposed to return the result in char *out..

Quote

Together we might liveDivided we must fall

 

Posted

Just in case someone is helped by this code, I'm going to post it here

$struct=DllStructCreate("char[128];char[128];char[128];")
DllStructSetData($struct,1,$in)
DllStructSetData($struct,2,$mid)
DllStructSetData($struct,3,$out)
DllCall("dlmid.dll","none","yintomid","ptr",DllStructGetPtr($struct,1),"ptr",DllStructGetPtr($struct,2),"ptr",DllStructGetPtr($struct,3))
Msgbox(0,"",DllStructGetData($struct,3))

Can't cease to amaze myself

Quote

Together we might liveDivided we must fall

 

Posted

Now that you've done it the hard way, look at DllCall()'s "str" type. You're also leaking memory doing it that way.

Posted

Yea..I need to Destroy the struct afterwards..I tried it with "str" by default, but I couldn't get a pointer to the data..

Quote

Together we might liveDivided we must fall

 

Posted

PS..Thanx for the Destroy tip..forgot to do that :whistle:..I'm pretty sloppy mostly

Quote

Together we might liveDivided we must fall

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...