-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathirc11.cpp
71 lines (52 loc) · 1.56 KB
/
irc11.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
// irc09.cpp : main source file for irc09.exe
//
#include "stdafx.h"
#include "resource.h"
#include "View.h"
#include "aboutdlg.h"
#include "ChildFrm.h"
#include "MainFrm.h"
#include "irc11_i.c"
CAppModule _Module;
//class CNo5IrcModule : public ATL::CAtlExeModuleT< CNo5IrcModule >
//{
//public:
// DECLARE_LIBID(LIBID_MyServerLib)
// //DECLARE_REGISTRY_APPID_RESOURCEID(IDR_MYSERVER, "{24061199-b890-43b7-bda3-cf5b7d82a6f4}")
//};
//
//CNo5IrcModule _AtlModule;
BEGIN_OBJECT_MAP(ObjectMap)
END_OBJECT_MAP()
int Run(LPTSTR /*lpstrCmdLine*/ = NULL, int nCmdShow = SW_SHOWDEFAULT)
{
CMessageLoop theLoop;
_Module.AddMessageLoop(&theLoop);
CMainFrame wndMain;
if(wndMain.CreateEx() == NULL)
{
ATLTRACE(_T("Main window creation failed!\n"));
return 0;
}
wndMain.ShowWindow(nCmdShow);
int nRet = theLoop.Run();
_Module.RemoveMessageLoop();
return nRet;
}
int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPTSTR lpstrCmdLine, int nCmdShow)
{
HRESULT hRes = ::CoInitialize(NULL);
ATLASSERT(SUCCEEDED(hRes));
CWinSockDLL dll(2, 2);
AtlInitCommonControls(ICC_COOL_CLASSES | ICC_BAR_CLASSES| ICC_TREEVIEW_CLASSES); // add flags to support other controls
hRes = _Module.Init(NULL, hInstance,&LIBID_MyServerLib);
ATLASSERT(SUCCEEDED(hRes));
HMODULE hInstRich = ::LoadLibrary(CRichEditCtrl::GetLibraryName());
ATLASSERT(hInstRich != NULL);
AtlAxWinInit();
int nRet = Run(lpstrCmdLine, nCmdShow);
::FreeLibrary(hInstRich);
_Module.Term();
::CoUninitialize();
return nRet;
}