Oxin8 Posted January 19, 2006 Share Posted January 19, 2006 I was wondering if anyone in here had ideas for how I could create a DllStruct within another Struct and get the altered Struct returned and retrieve the data. Little pseudo example: struct1 = dwordA struct2 = dwordB & struct1 dllcall(some function that alters the struct, ptr, dllstructgetptr(struct2) now get the altered dwordA sorry about crappy example... ~My Scripts~ *********_XInput UDF for Xbox 360 ControllerSprayPaint_MouseMovePlus Link to comment Share on other sites More sharing options...
jpm Posted January 19, 2006 Share Posted January 19, 2006 I was wondering if anyone in here had ideas for how I could create a DllStruct within another Struct and get the altered Struct returned and retrieve the data.Little pseudo example:struct1 = dwordAstruct2 = dwordB & struct1dllcall(some function that alters the struct, ptr, dllstructgetptr(struct2)now get the altered dwordAsorry about crappy example...first define the struct2 with the 2 dword$struct2=DllStructCreate("dword;dword")Then remap the second dword to struct1$struct1=DllStructCreate("dword",DllStructGetPtr($struct2,2))you can now use struct1 and struct2 when you need Link to comment Share on other sites More sharing options...
Oxin8 Posted January 19, 2006 Author Share Posted January 19, 2006 what if struct1 has multiple elements in it? i'm sorry i didn't make it clear or specify at all but struct1 contains about 5 different variables and i'm pretty sure i tried getting it to work with the best of my ability. ~My Scripts~ *********_XInput UDF for Xbox 360 ControllerSprayPaint_MouseMovePlus Link to comment Share on other sites More sharing options...
DaveF Posted January 19, 2006 Share Posted January 19, 2006 What's the prototype for the function that you're calling? What's the prototype for the structure? Does the call to DllCall fail or succeed? If it succeeds have you tried a DllCall to GetLastError, a-la: $errorCall = DllCall(@SystemDir & "\kernel32.dll", "int", "GetLastError") ...to get the last Win32 system error? Please post enough of your code to show the building of the struct and tha calling of the DLL function; no one call steal your killer app if you post only that much... Yes yes yes, there it was. Youth must go, ah yes. But youth is only being in a way like it might be an animal. No, it is not just being an animal so much as being like one of these malenky toys you viddy being sold in the streets, like little chellovecks made out of tin and with a spring inside and then a winding handle on the outside and you wind it up grrr grrr grrr and off it itties, like walking, O my brothers. But it itties in a straight line and bangs straight into things bang bang and it cannot help what it is doing. Being young is like being like one of these malenky machines. Link to comment Share on other sites More sharing options...
Oxin8 Posted January 19, 2006 Author Share Posted January 19, 2006 i haven't been home yet to try the get last error thing but the api call i'm talking about would be XInputGetState. It uses a XINPUT_STATE structure with a XINPUT_GAMEPAD structure within it. I know the function called correctly because the XINPUT_STATE packetnum changes when I press a button. This was awhile ago and since I've been getting more and more into API programming I wanted to see if it could be done. I ended up writting a vb wrapper dll and it works fine. All the code is in my _XInput UDF located at:http://www.autoitscript.com/forum/index.php?showtopic=20161 ~My Scripts~ *********_XInput UDF for Xbox 360 ControllerSprayPaint_MouseMovePlus Link to comment Share on other sites More sharing options...
DaveF Posted January 20, 2006 Share Posted January 20, 2006 Ejoc, the original author of the DllStruct functions, posted this UDF for the purpose of accessing substructs. I haven't used it, so I can't attest to its functionality... Yes yes yes, there it was. Youth must go, ah yes. But youth is only being in a way like it might be an animal. No, it is not just being an animal so much as being like one of these malenky toys you viddy being sold in the streets, like little chellovecks made out of tin and with a spring inside and then a winding handle on the outside and you wind it up grrr grrr grrr and off it itties, like walking, O my brothers. But it itties in a straight line and bangs straight into things bang bang and it cannot help what it is doing. Being young is like being like one of these malenky machines. Link to comment Share on other sites More sharing options...
Oxin8 Posted January 20, 2006 Author Share Posted January 20, 2006 That UDF doesn't work anymore, sadly. I did get it working though. Ended up using what jpm gave as a solution. Thanks you guys. Now I got to go to sleep but tomorrow I have a UDF to rewrite without a crappy vb wrapper. ~My Scripts~ *********_XInput UDF for Xbox 360 ControllerSprayPaint_MouseMovePlus 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