xroot Posted October 19, 2008 Share Posted October 19, 2008 My 2 cents on Kips "Dll Call like C++". I don't think it's "Much easier" but the idea is very interesting. Kip said "You'll still have to change the data types" and Valik is right, if you have to dink with it why not just use the DllCall, most likely you have used it in some code before. If you could use the MSDN Lib. as is with no changes, I think it would be a little easier, but you still have to have the correct data types. With this in mind I came up with this code trying to make it easier to change the data types. I setup a 2d Table; here you can add any data type you need. Now I think it's easier to work with. "BitBlt" is the biggest API call with 9 parms that I have used so I cut down the parm size from 32 to 14. (add more anytime if needed) It is still one function _dCall($iDll, $iFunc, $iParm1, $iParm2, $iParm3, .......$iParm14) When you copy from MSDN Lib. make sure to keep the format, one or no space after the comma's, like "int MessageBox(HWND hWnd,LPCTSTR lpText,LPCTSTR lpCaption,UINT uType)" or "int MessageBox(HWND hWnd, LPCTSTR lpText, LPCTSTR lpCaption, UINT uType)" Finally, I found 2 flavors of RtlMoveMemory API (see below), so you still might need to dink with changes to MSDN Lib. copy. Check out my code, has many examples, and always have FUN. VOID VOID RtlMoveMemory( RtlMoveMemory( IN PVOID Destination, IN VOID UNALIGNED *Destination, IN CONST VOID *Source, IN CONST VOID UNALIGNED *Source, IN ULONG Length IN SIZE_T Length ); );C__DllCall.zip 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