Translating C++ variable types to AutoIt types when using DllCall

Using DllCall in AutoIt given you enormous power to extend the functionality of AutoIt. It allows you to implement almost everyting in AutoIt that you can implement in C++.
However, one of the most difficult things when working with DllCall is to know how to type the variables that you pass to DllCall.
The table below show how to convert C++ and Windows API types to AutoIt types:

C++ AutoIt
LPCSTR
LPSTR
str
LPCWSTR
LPWSTR
wstr
LPVOID ptr
LPxyz xyz*
HINSTANCE handle
HRESULT long
LONGLONG
LARGE_INTEGER
INT64
ULONGLONG
ULARGE_INTEGER
UINT64
SIZE_T ULONG_PTR
wchar_t str*
PBYTE struct* (pointer to a struct created with StructCreate(byte[xxx]) )
NCRYPT_PROV_HANDLE handle
&NCRYPT_PROV_HANDLE handle*
LPCWSTR
wchar_t
wstr*

Tags: 

You might also be interested in...