#include "global.h"
#include "capp.h"
#include "cmemory.h"
#include <stdlib.h>

	CApplication app;
	extern DWORD maxMemorySize;

int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine,int nCmdShow)
{
	app.hInstance = hInstance;
	if (!app.Init())
		return -1;
	app.WaitLoop();
	app.Destroy();

#ifdef _DEBUG
	char str[20];
	if (_mem_new_)
	{
		itoa(_mem_new_, str, 10);
		MessageBox(0, "Zostala alokovana pamat NEW", str, MB_OK);
	}
	if (_mem_cmemory_)
	{
		itoa(_mem_cmemory_, str, 10);
		MessageBox(0, "Zostala alokovana pamat CMEMORY", str, MB_OK);
	}
	if (_mem_alloc_)
	{
		itoa(_mem_alloc_, str, 10);
		MessageBox(0, "Zostala alokovana pamat MALLOC", str, MB_OK);
	}

//	itoa(maxMemorySize, str,10);
//	MessageBox(0, "Max. pamat", str, MB_OK);

#endif

	return 0; 
}