Hamburger1993 Posted November 11, 2013 Share Posted November 11, 2013 (edited) Hey! Currently i'am trying to programm a funktion like DllCall for C++. Do you got any tricks how to handle the specification of the variables as string? sample: DllCall("Dllname", "ReturnType", "FunctionName", "float", $fHeight, "float", $fWidth) Currently i have to programm for every funtion that i want to include something like this: HRESULT URLDownloadToFileA(LPUNKNOWN pCaller,LPCSTR szURL,LPCSTR szFileName, DWORD dwReserved,LPBINDSTATUSCALLBACK lpfnCB) { typedef HRESULT (P_OT)(LPUNKNOWN, LPCSTR, LPCSTR,DWORD,LPBINDSTATUSCALLBACK); P_OT* OT; HMODULE hLib; hLib = LoadLibraryA("Urlmon.dll"); if(hLib) { OT = (P_OT*)GetProcAddress(hLib, "URLDownloadToFileA"); if(OT) return OT(pCaller,szURL,szFileName, dwReserved,lpfnCB); else return NULL; } else return NULL; } Edited November 11, 2013 by Hamburger1993 Link to comment Share on other sites More sharing options...
trancexx Posted November 11, 2013 Share Posted November 11, 2013 That's how you should do it (more or less). DllCall written for C++ and used from that language doesn't make sense.I saw the other thread you made about the AutoIt source, presumably you are interested in AutoIt's Dllcall implementation. Well, the source that was available for download didn't include DllCall code so you aren't at lost.AutoIt's DllCall is form of JIT compilation, if that rings any bells to you. You don't want it in your code.I have written DllCall alike code for some other scripting language which unfortunately is also closed source (for time being) but if you badly need to do things wrong I can publish my code so that you can see general idea. ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
Hamburger1993 Posted November 11, 2013 Author Share Posted November 11, 2013 (edited) Hey thanks for your replay. Yeah it would be pretty nice if you could share it! Its just for understanding parts like handling the parameters ;-) But i solved my problem thanks alot ^.^ Edited November 11, 2013 by Hamburger1993 Link to comment Share on other sites More sharing options...
Albie Posted November 15, 2013 Share Posted November 15, 2013 Thanks. 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