ShelbySue Posted April 8, 2005 Share Posted April 8, 2005 (edited) I am trying to access some dll functions that require a structure be populated and then returns the results in the same structure. I am looking for help in the following places. I am not attempting to get anyone to do this for me, I just need help getting off dead-center: 1. What is the best "substitute" for a structure. A string? An Array? 2. I can call the RtlMoveMemory from kernel.dll, but need to be able to copy bytes starting at an offset from the start of the structure. ( ie ->destination + 4, for 4 bytes) ;Public Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" _ ; (Destination As Any, Source As Any, ByVal Length As Long) Again, I am not asking anyone to create this for, just help with how to simulate a structure and then access the data within the simulation. However, to aid in your discussion, here is one of the functions I am attempting to call. DWORD RasSetEntryDialParams( LPTSTR lpszPhonebook, // pointer to the full path and filename of the phonebook file LPRASDIALPARAMS lprasdialparams, // pointer to a structure with the new connection parameters BOOL fRemovePassword // indicates whether to remove password from entrys parameters ); typedef struct tagRASDIALPARAMSA { DWORD dwSize; CHAR szEntryName[RAS_MaxEntryName + 1]; CHAR szPhoneNumber[RAS_MaxPhoneNumber + 1]; CHAR szCallbackNumber[RAS_MaxCallbackNumber + 1]; CHAR szUserName[uNLEN + 1]; CHAR szPassword[PWLEN + 1]; CHAR szDomain[DNLEN + 1]; #if (WINVER >= 0x401) DWORD dwSubEntry; ULONG_PTR dwCallbackId; #endif } RASDIALPARAMSA, *LPRASDIALPARAMSA; EDI: Or if any of you gurus want to wrap this into a cleaner dll that I can access the individual parameters? Edited April 8, 2005 by ShelbySue Link to comment Share on other sites More sharing options...
Ejoc Posted April 8, 2005 Share Posted April 8, 2005 Dunno how you would build it in AutoIt, but you could make a dll wrapper for it using C/C++.... Write a function thats takes a bunch of strings, builds the struct calls the real dll functions, and destructs the returned struct back into strings. Start -> Programs -> AutoIt v3 -> AutoIt Help File -> Index -> (The Function you are asking about)----- Links -----DllStruct UDFsRSA Crypto UDFs Link to comment Share on other sites More sharing options...
kjactive Posted April 8, 2005 Share Posted April 8, 2005 (edited) Well I don't know if this is what you'r getting at but to do a structure to a library call is done in this manner... the ending _ character is a kind of new line char... $var = DllCall(library,hwnd,Func to call in library,_ "hwnd",value,_ "int",value,_ "int",value ) The Hwnd & Int etc. is keywords that indicate to Autoit what to expect, well you can look these up else where - This would be how you normally insert a structure into a dll library call... Kåre Edited April 8, 2005 by kjactive Au3PP 4.1 - Autoit3 preprocessor, optimize speed, performance to scripts and do executes....[/url]Au3Calibur - Create libraries of commonly used code excerptsWords manipulate UDF, functions that is lent from the rexx language, topics and index file includedCustomDialog UDF to include custom made dialogs like a extended colorpick requester to scripts...[url="ftp://fritidshjemmet.com/Autoit3/SysColor.zip"]SysColor UDF a low level color library to manipulate RGB and Hex values...Shell32 UDF to Automate Windows® operating tasks from native dialog and Wizards browsers... Optimized the CodeWicard with options to generate browser code etc... Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now