If your application is crashing mid way through execution then you are definitely getting a runtime error; what does that error say? (Control Panel -> Administrative Tools -> Event Viewer: Application section). Please include that in your next post.
I don't know what "DllCall()" is from, are you certain that it is a variadic function?
Usually crashes like this occur because the function that the application was expecting to be avalible at runtime is not loaded into memory. There are a few things that you could try, the first one I would suggest is inserting a break point just before the suspected call and enumerating the DLL files that are loaded with either SysInternals 'Procmon' or the command line tool 'tasklist' like this:
Thanks for answering , I tried the Event Vierwer thing, but once I opened it, I couldn't find my processes, which is called DLLCall.au3 (which is an Autoit script that calls the dll) of course when the proccess was running.
I also tried the command you game me but this is what happned:
C:\Users\Nyname>tasklist /m /fi "imagename eq DLLCall.au3"
INFO: No tasks are running which match the specified criteria.
DllCall() is a function in Autoit that calls a dll, as mention in the original post. I now for a fact that the imgsearch.dll is loaded to memory properly because I get a msgbox
1 2 3 4 5 6 7 8
hinstLib = LoadLibrary(TEXT("D:\\Downloads\\SmartGuy\\SmartGuy\\imgs\\imgsearch.dll"));
// If the handle is valid, try to get the function address.
if (hinstLib != NULL)
{
std::cout << "DLL Called! Hello AutoIt!" << std::endl; // This silly function will just output in our Autoit script "Dll Called!"
MessageBox(0, TEXT("hinstLib != NULL"), TEXT("Simple Dll..."),0); //
When you actually go to call the function, are you remembering to initialize the void pointer 'HBMP' so that it points to a space that was intentionally allocated for it with something like "memset(...)" "malloc()"? I only ask because you admit to being a 'noob' as you put it.