MCPcopy Create free account
hub / github.com/acl-dev/acl / InitInstance

Method InitInstance

lib_fiber/samples-gui/WinEchod/WinEchod.cpp:39–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37// CWinEchodApp ��ʼ��
38
39BOOL CWinEchodApp::InitInstance()
40{
41 // ���һ�������� Windows XP �ϵ�Ӧ�ó����嵥ָ��Ҫ
42 // ʹ�� ComCtl32.dll �汾 6 ����߰汾�����ÿ��ӻ���ʽ��
43 //����Ҫ InitCommonControlsEx()�����򣬽��޷��������ڡ�
44 INITCOMMONCONTROLSEX InitCtrls;
45 InitCtrls.dwSize = sizeof(InitCtrls);
46 // ��������Ϊ��������Ҫ��Ӧ�ó�����ʹ�õ�
47 // �����ؼ��ࡣ
48 InitCtrls.dwICC = ICC_WIN95_CLASSES;
49 InitCommonControlsEx(&InitCtrls);
50
51 CWinApp::InitInstance();
52
53 if (!AfxSocketInit()) {
54 AfxMessageBox(IDP_SOCKETS_INIT_FAILED);
55 return FALSE;
56 }
57
58
59 // ���� shell ���������Է��Ի������
60 // �κ� shell ����ͼ�ؼ��� shell �б���ͼ�ؼ���
61 CShellManager *pShellManager = new CShellManager;
62
63 // ���Windows Native���Ӿ����������Ա��� MFC �ؼ�����������
64 CMFCVisualManager::SetDefaultManager(RUNTIME_CLASS(CMFCVisualManagerWindows));
65
66 // ��׼��ʼ��
67 // ���δʹ����Щ���ܲ�ϣ����С
68 // ���տ�ִ���ļ��Ĵ�С����Ӧ�Ƴ�����
69 // ����Ҫ���ض���ʼ������
70 // �������ڴ洢���õ�ע�����
71 // TODO: Ӧ�ʵ��޸ĸ��ַ�����
72 // �����޸�Ϊ��˾����֯��
73 SetRegistryKey(_T("Ӧ�ó��������ɵı���Ӧ�ó���"));
74
75 CWinEchodDlg dlg;
76 m_pMainWnd = &dlg;
77 INT_PTR nResponse = dlg.DoModal();
78 if (nResponse == IDOK) {
79 // TODO: �ڴ˷��ô�����ʱ��
80 // ��ȷ�������رնԻ���Ĵ���
81 } else if (nResponse == IDCANCEL) {
82 // TODO: �ڴ˷��ô�����ʱ��
83 // ��ȡ�������رնԻ���Ĵ���
84 } else if (nResponse == -1) {
85 TRACE(traceAppMsg, 0, "����: �Ի��򴴽�ʧ�ܣ�Ӧ�ó���������ֹ��\n");
86 TRACE(traceAppMsg, 0, "����: ������ڶԻ�����ʹ�� MFC �ؼ������޷� #define _AFX_NO_MFC_CONTROLS_IN_DIALOGS��\n");
87 }
88
89 // ɾ�����洴���� shell ��������
90 if (pShellManager != NULL) {
91 delete pShellManager;
92 }
93
94 // ���ڶԻ����ѹرգ����Խ����� FALSE �Ա��˳�Ӧ�ó���
95 // ����������Ӧ�ó������Ϣ�á�
96 return FALSE;

Callers

nothing calls this directly

Calls 1

InitInstanceFunction · 0.50

Tested by

no test coverage detected