blakel Posted April 13, 2007 Share Posted April 13, 2007 I have a function as follows: int myFunction (char** arg, char** ret); The requested argument is: arg[] = {"str1","strn",NULL}; and ret is an array of strings with the results. would someone help me with the dllcall? Link to comment Share on other sites More sharing options...
blakel Posted April 13, 2007 Author Share Posted April 13, 2007 the help file does not refer to arrays of strings or two dimensional arrays Link to comment Share on other sites More sharing options...
blakel Posted April 13, 2007 Author Share Posted April 13, 2007 i know it refers to arrays in general, but what is the syntax for dllcall() Link to comment Share on other sites More sharing options...
Developers Jos Posted April 13, 2007 Developers Share Posted April 13, 2007 Ok. The helpfile should have told you this, but obviously not- DllCall ( "dll", "return type", "function" [, "type1", param1 [, "type n", param n]] ) Example: MsgBox API: DllCall("user32.dll", "int", "MessageBox", "hwnd", 0, "str", "Some text", "str", "Some title", "int", 0) .. wondering here when you will be answering the OP's question .... SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Developers Jos Posted April 13, 2007 Developers Share Posted April 13, 2007 What is arg[] = {"str1","strn",NULL}; anyway? I've never seen it before.Then I would advice you to either post a question about the OP question Or just not to post at all if you are not sure about the answer, but atleast stop acting like a smart ass by pointing to the Helpfile and even Bolding the word should like you want to say the OP is stupid. My 2 cents . SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
BrettF Posted April 13, 2007 Share Posted April 13, 2007 Then I would advice you to either post a question about the OP question Or just not to post at all if you are not sure about the answer,but atleast stop acting like a smart ass by pointing to the Helpfile and even Bolding the word should like you want to say the OP is stupid.My 2 cents .Sorry Blakel and thanks JdeB, for slapping me in the face and telling me to stop . I will cease being a smartass, and try to start over. Here I go.Hi BlakeL,Sorry about being a smartass earlier, I will now try to help you as much as I can in my power.Ok so from what I can see, you have your function, myfunction, and then $ret, is an array with the results. And now you want to perform a dllcall on a dll right? Ok, so what I now need to know is what dll you are trying to call, so I can help you with the code.RegardsBert Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
blakel Posted April 14, 2007 Author Share Posted April 14, 2007 the question is how do i get an array of strings into a dllcall. "arg[] = {"str1","strn",NULL};" is a typo better example of what would be passed in programming in c: -- c code-- char** ArrayofStrings = {"String One", "String Two", "String Three"}; -- / c code -- Link to comment Share on other sites More sharing options...
BrettF Posted April 14, 2007 Share Posted April 14, 2007 Ok. Get ready, cause here I go. Now I'm guessing your array would have the type and parameters etc.? So Your array looks like: $myarray[7] = ["Dll", "ReturnType", "Function", "Type1", "Param1", "Type2", "Pram2"] oÝ÷ Ù*-ë2Ö±~ÝWX¬jëh×6 DllCall ( "dll", "return type", "function" [, "type1", param1 [, "type n", param n]] ) oÝ÷ Ù*.²)ථ¶²Ü(ºWmº¹èºÙbëaÆ®¶s`¤FÆÄ6ÆÂb33c¶×'&³ÒÂb33c¶×'&³%ÒÂb33c¶×'&³5ÒÂb33c¶×'&³EÒÂb33c¶×'&³UÒÂb33c¶×'&³eÒÂb33c¶×'&³uÒ oÝ÷ Ùg¡j÷櫬´ß©²jºÚËØ^¶Zéj»l{a{»az|«Þ¶©j»lYQzÛ« That works by $i incrementing by one every time- so every time the loop completes one, $i = +1. Ubound ("Array"), is a function that tells the total in the array. So when $i = 7, the loop ends. The array is called by the variable name ($myarray) and then the value of $i in the [] ([$i]). So thats basically it. Good luck- Brett Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! 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