As the title states, I am having issues creating a DLL for use with my AutoIt script.
It compiles without error, however I can not get it to work with C++ or AutoIt - however I have not worked with DLLs in AutoIt before. Are there any good resources to aid in creation of DLLs? I am guessing there is a problem with my code.
As you will see in the header, I want to return a string (or array of chars). The two parameters are also string/char arrays.
My header:
#define DLL_EXPORT __declspec (dllexport) #ifdef __cplusplus extern "C" { #endif char * DLL_EXPORT licenseCheck(char * salt, char * user);
That is the header of the actual DLL.
The following is the C++ code I am using in an attempt to access this DLL:
#include <iostream> #include <windows.h> using namespace std; typedef char (*LicFunc)(char, char); HINSTANCE hinstDLL; int main() { // LicFunc licenseCheck("",""); hinstDLL = LoadLibrary("../../../MichaelsFuncs/bin/Release/MichaelsFuncs.dll"); FARPROC licenseCheck = GetProcAddress(hinstDLL, "licenseCheck"); if (licenseCheck == 0) { cout << "licenseCheck is NULL\n"; return 0; } typedef char (__stdcall * pICFUNC)( char *, char *); pICFUNC licenseCheck(char, char); licenseCheck = pICFUNC(licenseCheck); cout << licenseCheck(*"<|+5 :{ax?H_+,^o", *"Test"); FreeLibrary(hinstDLL); return 0; }
And this is my AutoIt code, which is also trying to access this DLL:
I am sure the errors are in the DLL - can anyone please guide me along to get this DLL working properly?
The compiled DLL is attached.
Thanks






