|
1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // SerialPort.cpp : Defines the class behaviors for the application. |
|
15 // @internalComponent. |
|
16 // |
|
17 // |
|
18 |
|
19 #include "stdafx.h" |
|
20 #include "SerialPort.h" |
|
21 #include "SerialPortDlg.h" |
|
22 |
|
23 #ifdef _DEBUG |
|
24 #define new DEBUG_NEW |
|
25 #undef THIS_FILE |
|
26 static char THIS_FILE[] = __FILE__; |
|
27 #endif |
|
28 |
|
29 // |
|
30 // CSerialPortApp |
|
31 |
|
32 BEGIN_MESSAGE_MAP(CSerialPortApp, CWinApp) |
|
33 //{{AFX_MSG_MAP(CSerialPortApp) |
|
34 // NOTE - the ClassWizard will add and remove mapping macros here. |
|
35 // DO NOT EDIT what you see in these blocks of generated code! |
|
36 //}}AFX_MSG |
|
37 ON_COMMAND(ID_HELP, CWinApp::OnHelp) |
|
38 END_MESSAGE_MAP() |
|
39 |
|
40 // |
|
41 // CSerialPortApp construction |
|
42 |
|
43 CSerialPortApp::CSerialPortApp() |
|
44 { |
|
45 // TODO: add construction code here, |
|
46 // Place all significant initialization in InitInstance |
|
47 } |
|
48 |
|
49 // |
|
50 // The one and only CSerialPortApp object |
|
51 |
|
52 CSerialPortApp theApp; |
|
53 |
|
54 // |
|
55 // CSerialPortApp initialization |
|
56 |
|
57 BOOL CSerialPortApp::InitInstance() |
|
58 { |
|
59 AfxEnableControlContainer(); |
|
60 |
|
61 // Standard initialization |
|
62 // If you are not using these features and wish to reduce the size |
|
63 // of your final executable, you should remove from the following |
|
64 // the specific initialization routines you do not need. |
|
65 |
|
66 #ifdef _AFXDLL |
|
67 Enable3dControls(); // Call this when using MFC in a shared DLL |
|
68 #else |
|
69 Enable3dControlsStatic(); // Call this when linking to MFC statically |
|
70 #endif |
|
71 |
|
72 CSerialPortDlg dlg; |
|
73 m_pMainWnd = &dlg; |
|
74 int nResponse = dlg.DoModal(); |
|
75 if (nResponse == IDOK) |
|
76 { |
|
77 // TODO: Place code here to handle when the dialog is |
|
78 // dismissed with OK |
|
79 } |
|
80 else if (nResponse == IDCANCEL) |
|
81 { |
|
82 // TODO: Place code here to handle when the dialog is |
|
83 // dismissed with Cancel |
|
84 } |
|
85 |
|
86 // Since the dialog has been closed, return FALSE so that we exit the |
|
87 // application, rather than start the application's message pump. |
|
88 return FALSE; |
|
89 } |
|
90 |