// Test.cpp : �������̨Ӧ�ó������ڵ㡣
//

#include "stdafx.h"
#include "Test.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#endif


// Ψһ��Ӧ�ó������
typedef BOOL (WINAPI *GenerationThumbnail)(IN LPCTSTR lpImgPath, IN LPCTSTR lpNewImgPath, IN DWORD dwWidth, IN DWORD dwHeight, IN DWORD dwQuality);

CWinApp theApp;

using namespace std;

int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
{
	int nRetCode = 0;

	HMODULE hModule = ::GetModuleHandle(NULL);

	if (hModule != NULL)
	{
		// ��ʼ�� MFC ����ʧ��ʱ��ʾ����
		if (!AfxWinInit(hModule, NULL, ::GetCommandLine(), 0))
		{
			// TODO: ���Ĵ�������Է���������Ҫ
			_tprintf(_T("����: MFC ��ʼ��ʧ��\n"));
			nRetCode = 1;
		}
		else
		{
			// TODO: �ڴ˴�ΪӦ�ó������Ϊ��д���롣
		}
	}
	else
	{
		// TODO: ���Ĵ�������Է���������Ҫ
		_tprintf(_T("����: GetModuleHandle ʧ��\n"));
		nRetCode = 1;
	}

	HMODULE hdll = LoadLibrary(_T("SimpleImgThumbnail_x86.dll"));

	if (hdll == NULL)
	{
		//dwError = GetLastError();
		AfxMessageBox(_T("���ض�ȡӲ����Ϣģ��ʧ�ܣ�"));
		return 0;
	}

	GenerationThumbnail gt = NULL;
	gt = (GenerationThumbnail)::GetProcAddress(hdll, "GenerationThumbnail");
	if ( gt == NULL )
		return 0;

	gt(_T(".\\04.jpg"),_T(".\\003.jpg"),2320,2067,0);

	return nRetCode;
}