-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathno5_3.cpp
More file actions
83 lines (66 loc) · 2.02 KB
/
Copy pathno5_3.cpp
File metadata and controls
83 lines (66 loc) · 2.02 KB
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
72
73
74
75
76
77
78
79
80
81
82
83
// ycht02.cpp : main source file for ycht02.exe
//
#include "stdafx.h"
#include "initguid.h"
#include "resource.h"
#include "no5_3.h"
#include "no5_3_i.c"
#include "aboutdlg.h"
#include "yahoochatview.h"
#include "ChildFrm.h"
#include "MainFrm.h"
#include "no5app.h"
#include <no5tl\winsocketwithhandler.h>
#include <no5tl\no5richedit.h>
#include "No5Obj.h"
#include "YahooTxtObj.h"
NO5TL::CSocketWindow NO5TL::CWinSocketData::m_wnd;
RegisterTabbedMDIMessages g_RegisterTabbedMDIMessages;
CAppModule _Module;
CNo5App g_app;
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;
try{
nRet = theLoop.Run();
}catch(...){
int debug = 0;
}
_Module.RemoveMessageLoop();
return nRet;
}
int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPTSTR lpstrCmdLine, int nCmdShow)
{
NO5TL::CWinSockDLL sdll;
NO5TL::CRichEditLib richlib;
HRESULT hRes = ::CoInitialize(NULL);
// If you are running on NT 4.0 or higher you can use the following call instead to
// make the EXE free threaded. This means that calls come in on a random RPC thread.
// HRESULT hRes = ::CoInitializeEx(NULL, COINIT_MULTITHREADED);
ATLASSERT(SUCCEEDED(hRes));
// this resolves ATL window thunking problem when Microsoft Layer for Unicode (MSLU) is used
::DefWindowProc(NULL, 0, 0, 0L);
AtlInitCommonControls(ICC_COOL_CLASSES | ICC_BAR_CLASSES |ICC_TREEVIEW_CLASSES); // add flags to support other controls
hRes = _Module.Init(ObjectMap, hInstance,&LIBID_NO5Lib);
ATLASSERT(SUCCEEDED(hRes));
g_app.Init();
AtlAxWinInit();
ATLTRACE("before Run\n");
int nRet = Run(lpstrCmdLine, SW_MAXIMIZE);
ATLTRACE("after Run\n");
g_app.Term();
_Module.Term();
::CoUninitialize();
return nRet;
}