[Ace-users] How to integrate ACE with WTL on windows?

zhengfish zhengfish at gmail.com
Fri Aug 3 08:44:59 CDT 2007

I want to integrate ACE lib with WTL on windows platform.

But the ACE need a event loop which against WTL's message event loop,
how to avoid this?

the WTL main entry frame as fellow, where I can add the ACE instance
event loop code?

CAppModule _Module;

int Run(LPTSTR /*lpstrCmdLine*/ = NULL, int nCmdShow = SW_SHOWDEFAULT)
	CMessageLoop theLoop;

	CMainFrame wndMain;

	RECT rc = {0, 0, 350, 135};
	if(wndMain.CreateEx(NULL, &rc) == NULL)
		ATLTRACE(_T("Main window creation failed!\n"));
		return 0;


	int nRet = theLoop.Run();

	return nRet;

int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/,
LPTSTR lpstrCmdLine, int nCmdShow)
	HRESULT hRes = ::CoInitialize(NULL);

	::DefWindowProc(NULL, 0, 0, 0L);

	AtlInitCommonControls(ICC_BAR_CLASSES);	// add flags to support other

	hRes = _Module.Init(NULL, hInstance);

	int nRet = Run(lpstrCmdLine, nCmdShow);


	return nRet;

More information about the Ace-users mailing list