Jump to content

DLL HELP!


SDX2000
 Share

Recommended Posts

Hi,

I would be grateful if some body could tell me how to pass a pre-allocated buffer to a DLL function?

Eg.

DllCall("user32.dll", "int", "wsprintf", "str", "", "str", "%s", "str", "Hello World")

Note:

1)I need to pass the pre-allocated buffer as the first argument.

2)How do I call a Dll function with a calling convention other than __stdcall

Drive C:\ is not ready, close the door!

Link to comment
Share on other sites

Thanks for the extremely prompt reply. Though I could not find the aforementioned functions within the version of autoit I have with me (v3). Let me download the latest and get back to you.

for 2:

cdecl ?

Yes cdecl would be good. If this were possible we might be able to use a variable number of arguments.

Drive C:\ is not ready, close the door!

Link to comment
Share on other sites

cdecl is supported, all sqlite exports are cdecl ;)

from helpfile:

By default, AutoIt uses the 'stdcall' calling method. To use the 'cdecl' method place ':cdecl' after the return type.
DllCall("SQLite.dll", "int:cdecl", "sqlite3_open", "str", $sDatabase_Filename , "long_ptr", 0).
CoProc Multi Process Helper libraryTrashBin.nfshost.com store your AutoIt related files here!AutoIt User Map
Link to comment
Share on other sites

Nah, wsprintf was only meant as an example. Actually I developed a wrapper around the Win Sock API and exported my functions from a dll. I Needed some way to pass a pre-allocated buffer to the recv() (WinSock API)

But I was rather surprised to see the same functionality as part of the AutoIt function set in the latest version (v3.2)

Drive C:\ is not ready, close the door!

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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