Jump to content

Recommended Posts

Posted

I'm not very learned in the ways of DLL calling, so I have a few questions for the experts here.

1) If a DLL function accepts a pointer as a parameter that, after the function returns, will point to some return value, how do you handle that? Structs?

2) What happens if you need a pointer inside a struct? MSDN always says you need a "pointer to a string" or a "pointer to an array" instead of an actual string or array. Does AutoIt handle this automatically?

3) How do you get a string into a struct, anyway? What about Unicode strings? (for example the "PCWSTR" type, which apparently is a pointer to a Unicode string)

4) What should you do if a piece of a struct is a "union{...}" of two different types, and the function expects it to be one type or the other based on some other parameter? Do you just use the single type that matches the way you're using it?

5) If you don't want or know how to use a callback function, what types/values should be used in a struct for a "pointer to a callback function" and a "pointer to application-defined reference data"?

Answers and/or explanations for any of these questions are much appreciated. Thanks!

Posted

Thanks for that library, Piccaso, but unfortunately it doesn't contain any of the functions I'm looking at (most of them are new to Vista, which probably explains a lot).

Posted (edited)

The one that initially prompted me to make this post was TaskDialogIndirect. All five things I asked about are somehow involved in this function. (I am also interested in the functions that deal with NTFS transactions, but one thing at a time)

Edited by Sokko
Posted (edited)

If you give us the function declarations, we can translate them with maybe a little extra info such as struct declarations.

Eck, you posted a minute before me. I'll get to work translating.

Edited by Mr Icekirby
Posted

Well, I took a look and I don't know how to translate unions into AutoIt. I also never looked into the callbacks so I can't help you there either. I would probably write a C++ dll with a much simpler function that loads the parameters into the struct.

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...