// QT-BUG19256.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <windows.h>
#include <stdio.h>

typedef int (__cdecl *testFun)(void);

int _tmain(int argc, _TCHAR* argv[])
{
	HINSTANCE hinstLib = 0; 
    testFun ProcAdd = 0; 
    DWORD error = 0;
     
    hinstLib = LoadLibrary(TEXT("mydll.dll")); 
 
    if (hinstLib != NULL) 
    { 
        ProcAdd = (testFun) GetProcAddress(hinstLib, "testi"); 
 
        if (NULL != ProcAdd) 
        {
            int test = 0;
			test = ProcAdd(); 
			printf("\n Dll load succees, testi() returned %d",test);
        }		
        FreeLibrary(hinstLib); 
    } 
	else {
        error = GetLastError();
		printf("\n Dll load failed windows error code %d", error);
	}

    return 0;

}

