ankitstr Posted November 10, 2009 Share Posted November 10, 2009 Hi all, I read an example of creating a dll file in VC++ and was managed to get a compiled dll for a simple addition function. Trying to run it with Autoit but instead of returning an array as in the documentation it's returning an int value 0. Any help would be much appreciated. Thanks in advance, Ankit [topic="80940"] AutoScript Creator, Script to automate anything![/topic] Link to comment Share on other sites More sharing options...
jvanegmond Posted November 10, 2009 Share Posted November 10, 2009 Check the value of the @error macro right after you do the DllCall. The help file specifies what the error value means. Your dll could be malformed (is this the right term?). github.com/jvanegmond Link to comment Share on other sites More sharing options...
ankitstr Posted November 10, 2009 Author Share Posted November 10, 2009 Check the value of the @error macro right after you do the DllCall. The help file specifies what the error value means. Your dll could be malformed (is this the right term?).That's the thing. The @error returns 0 which means it was successful! [topic="80940"] AutoScript Creator, Script to automate anything![/topic] Link to comment Share on other sites More sharing options...
martin Posted November 10, 2009 Share Posted November 10, 2009 That's the thing. The @error returns 0 which means it was successful! @error being zero means that no errors occurred but that isn't the same as success.What did you do in your dll to make it return an array? Did you return a pointer to the array?Did you use stdcall? Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
ankitstr Posted November 10, 2009 Author Share Posted November 10, 2009 @error being zero means that no errors occurred but that isn't the same as success. What did you do in your dll to make it return an array? Did you return a pointer to the array? Did you use stdcall? #include <windows.h> BOOL WINAPI DllMain ( HANDLE hModule, DWORD dwFunction, LPVOID lpNot) { return TRUE; } /* Add two integers */ _declspec (dllexport) int __stdcall sum(int a, int b){ return((int)(a+b));} The above code is what I had in my adder.c dll. [topic="80940"] AutoScript Creator, Script to automate anything![/topic] Link to comment Share on other sites More sharing options...
Zedna Posted November 10, 2009 Share Posted November 10, 2009 Post your Autoit code too. Resources UDF ResourcesEx UDF AutoIt Forum Search 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