added some development tools
[windows-sources.git] / developer / VC / WTL80 / Samples / TabBrowser / TabBrowser.cpp
blob7b98d6dc21bb7bc0f8fa21c475585643d4e6fa4f
1 // TabBrowser.cpp : main source file for TabBrowser.exe
2 //
4 #include "stdafx.h"
6 #include <atlframe.h>
7 #include <atlctrls.h>
8 #include <atlctrlx.h>
9 #include <atlctrlw.h>
10 #include <atldlgs.h>
11 #include <atlmisc.h>
13 #include "resource.h"
15 #include "BrowserView.h"
16 #include "CustomTabView.h"
17 #include "AddressCombo.h"
18 #include "OpenDlg.h"
19 #include "WindowsDlg.h"
20 #include "AboutDlg.h"
21 #include "MainFrm.h"
23 CAppModule _Module;
25 int Run(LPTSTR /*lpstrCmdLine*/ = NULL, int nCmdShow = SW_SHOWDEFAULT)
27 CMessageLoop theLoop;
28 _Module.AddMessageLoop(&theLoop);
30 CMainFrame wndMain;
32 if(wndMain.CreateEx() == NULL)
34 ATLTRACE(_T("Main window creation failed!\n"));
35 return 0;
38 wndMain.ShowWindow(nCmdShow);
40 int nRet = theLoop.Run();
42 _Module.RemoveMessageLoop();
43 return nRet;
46 int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPTSTR lpstrCmdLine, int nCmdShow)
48 HRESULT hRes = ::CoInitialize(NULL);
49 ATLASSERT(SUCCEEDED(hRes));
51 // this resolves ATL window thunking problem when Microsoft Layer for Unicode (MSLU) is used
52 ::DefWindowProc(NULL, 0, 0, 0L);
54 AtlInitCommonControls(ICC_COOL_CLASSES | ICC_BAR_CLASSES | ICC_USEREX_CLASSES);
56 hRes = _Module.Init(NULL, hInstance);
57 ATLASSERT(SUCCEEDED(hRes));
59 AtlAxWinInit();
61 int nRet = Run(lpstrCmdLine, nCmdShow);
63 _Module.Term();
64 ::CoUninitialize();
66 return nRet;