KalInEx Posted September 20, 2009 Share Posted September 20, 2009 (edited) I want to write a routine using VC++ express 2008 edition so that the execution speed is very fast for some pixel color testing routines I need. Writing the routines should not be difficult for me however making a DLL I Can call using DLLCall without getting errors saying the routine does not exist is not at least not for me =/ What I have done is this... 1: Started a new W32 project selecting DLL as the type 2: Compiled the code that was there it has a function returning 42 3: went into AutoIT using DLLCall and get error 3 tell me the function "fnDLLTest" does not exist =< I added a call to MessageBox so I would know at least the dll is loading and it is but that function which is susposeto be an example of an exported function is not being called. Just FYI This is my test CODE in AutoIT. $1="C:\Documents and Settings\HP_Administrator\Desktop\New Folder\DLLTest2\Release\DLLTest2.dll" $2=DllCall($1,"none","FNDLLTEST") MsgBox(1,@error,$2) The MsgBox shows error code 3 and the text 0. Help will be much appreciated =) EDIT: The name DNFLLTEST is just my latest try I had the capitalization correct in the beginning. Edited September 20, 2009 by KalInEx Link to comment Share on other sites More sharing options...
KalInEx Posted September 20, 2009 Author Share Posted September 20, 2009 UPDATE: I can call the routine using ordinal value 1 but not by name. Link to comment Share on other sites More sharing options...
Richard Robertson Posted September 20, 2009 Share Posted September 20, 2009 What is the function declaration in C++? The problem most likely is that you've got a decorated name. Link to comment Share on other sites More sharing options...
KalInEx Posted September 20, 2009 Author Share Posted September 20, 2009 (edited) Thanks! I googled "dll decorated names" and found a thread at codeguru.com saying that by using "extern C" it will force the names to ANSI C format which for me means the names are preserved. FYI the function prototype is this... __declspec(dllexport) int DLLTEST(int param); Still have 1 problem. The routine is being called by name now, its getting the parameter but I do not get a return value back its always 0. Edited September 20, 2009 by KalInEx Link to comment Share on other sites More sharing options...
martin Posted September 20, 2009 Share Posted September 20, 2009 Thanks! I googled "dll decorated names" and found a thread at codeguru.com saying that by using "extern C" it will force the names to ANSI C format which for me means the names are preserved. FYI the function prototype is this... __declspec(dllexport) int DLLTEST(int param); Still have 1 problem. The routine is being called by name now, its getting the parameter but I do not get a return value back its always 0. Are you remembering that the return value is an array? So if you have $Answer = DllCall(.......... $RealAnswer = $Answer[0] 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...
Andreik Posted September 20, 2009 Share Posted September 20, 2009 Thanks! I googled "dll decorated names" and found a thread at codeguru.com saying that by using "extern C" it will force the names to ANSI C format which for me means the names are preserved. FYI the function prototype is this...__declspec(dllexport) int DLLTEST(int param);Still have 1 problem. The routine is being called by name now, its getting the parameter but I do not get a return value back its always 0.Read here.You will be able to write a simple dll and know how to call the function from AutoIt. When the words fail... music speaks. 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