laosoi Posted August 16, 2007 Posted August 16, 2007 (edited) The first C++ code:extern "C" __declspec(dllexport) int * BioBus(void) {int*getlo=new int[3];getlo[0]=1000;getlo[1]=2000;getlo[2]=3000;return getlo;}Please teach me, how to get "getlo"?The second C++ code:extern "C" __declspec(dllexport) const char * BioBus(void) {const char * yo="Hello world!";return yo;} Autoit code: DLLCall($dll,"str","BioBus") run OK! But:extern "C" __declspec(dllexport) const char * BioBus(void) {string message="Hello world!";const char * yo=message.c_str();return yo;} When i use DLLCall($dll,"str","BioBus") it return wrong string. Please tell me how to solve these problem! Thank you! Edited August 16, 2007 by laosoi
Bert Posted August 16, 2007 Posted August 16, 2007 The Vollatran project My blog: http://www.vollysinterestingshit.com/
mrbond007 Posted August 16, 2007 Posted August 16, 2007 I'm no dll expert but maybe this helps : $dll_handle = DLLCall($dll,"str","BioBus") For $i = 1 To $dll[0] MsgBox(0, "", $dll[$i]) Next or $dll_handle = DLLCall($dll,"str","BioBus") For $i = 1 To Ubound($dll_handle) - 1 MsgBox(0, "", $dll[$i]) Next Projects : Space Regain - Memory Fusion - PWGT - Chip-ITGames : BrainPain - BrainPain Director's Cut - ProSpeed Games Pack (New)Vista vs XP : the forbidden fight
laosoi Posted August 16, 2007 Author Posted August 16, 2007 mrbond007, as your reply: $dll_handle = DLLCall($dll,"str","BioBus") For $i = 1 To Ubound($dll_handle) - 1 MsgBox(0, "", $dll_handle[$i]) Next But it returned an empty value! Anyway, thank you! Any ideas?
mrbond007 Posted August 16, 2007 Posted August 16, 2007 mrbond007, as your reply: $dll_handle = DLLCall($dll,"str","BioBus") For $i = 1 To Ubound($dll_handle) - 1 MsgBox(0, "", $dll_handle[$i]) Next But it returned an empty value! Anyway, thank you! Any ideas?maybe there is an error $dll_handle = DLLCall($dll,"str","BioBus") Msgbox(0, "", @error) if the msgbox returns a different value than 0 than check the help file. Sorry that i can't help you more than this Projects : Space Regain - Memory Fusion - PWGT - Chip-ITGames : BrainPain - BrainPain Director's Cut - ProSpeed Games Pack (New)Vista vs XP : the forbidden fight
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