]> git.saurik.com Git - apple/mdnsresponder.git/blob - Clients/PrinterSetupWizard/PrinterSetupWizardApp.cpp
mDNSResponder-87.tar.gz
[apple/mdnsresponder.git] / Clients / PrinterSetupWizard / PrinterSetupWizardApp.cpp
1 /*
2 * Copyright (c) 1997-2004 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22
23 Change History (most recent first):
24
25 $Log: PrinterSetupWizardApp.cpp,v $
26 Revision 1.3 2004/07/13 21:24:23 rpantos
27 Fix for <rdar://problem/3701120>.
28
29 Revision 1.2 2004/06/24 20:12:08 shersche
30 Clean up source code
31 Submitted by: herscher
32
33 Revision 1.1 2004/06/18 04:36:57 rpantos
34 First checked in
35
36
37 */
38
39 #include "stdafx.h"
40 #include "PrinterSetupWizardApp.h"
41 #include "PrinterSetupWizardSheet.h"
42 #include "DebugServices.h"
43
44 #ifdef _DEBUG
45 #define new DEBUG_NEW
46 #endif
47
48
49 // CPrinterSetupWizardApp
50
51 BEGIN_MESSAGE_MAP(CPrinterSetupWizardApp, CWinApp)
52 ON_COMMAND(ID_HELP, CWinApp::OnHelp)
53 END_MESSAGE_MAP()
54
55
56 // CPrinterSetupWizardApp construction
57
58 CPrinterSetupWizardApp::CPrinterSetupWizardApp()
59 {
60 // TODO: add construction code here,
61 // Place all significant initialization in InitInstance
62 }
63
64
65 // The one and only CPrinterSetupWizardApp object
66
67 CPrinterSetupWizardApp theApp;
68
69
70 // CPrinterSetupWizardApp initialization
71
72 BOOL CPrinterSetupWizardApp::InitInstance()
73 {
74 //
75 // initialize the debugging framework
76 //
77 debug_initialize( kDebugOutputTypeWindowsDebugger, "PrinterSetupWizard", NULL );
78 debug_set_property( kDebugPropertyTagPrintLevel, kDebugLevelTrace );
79
80
81 // InitCommonControls() is required on Windows XP if an application
82 // manifest specifies use of ComCtl32.dll version 6 or later to enable
83 // visual styles. Otherwise, any window creation will fail.
84 InitCommonControls();
85
86 CWinApp::InitInstance();
87
88 AfxEnableControlContainer();
89
90 CPrinterSetupWizardSheet dlg(IDS_CAPTION);
91
92 m_pMainWnd = &dlg;
93
94 try
95 {
96 INT_PTR nResponse = dlg.DoModal();
97
98 if (nResponse == IDOK)
99 {
100 // TODO: Place code here to handle when the dialog is
101 // dismissed with OK
102 }
103 else if (nResponse == IDCANCEL)
104 {
105 // TODO: Place code here to handle when the dialog is
106 // dismissed with Cancel
107 }
108 }
109 catch (CPrinterSetupWizardSheet::WizardException & exc)
110 {
111 MessageBox(NULL, exc.text, exc.caption, MB_OK|MB_ICONEXCLAMATION);
112 }
113
114 // Since the dialog has been closed, return FALSE so that we exit the
115 // application, rather than start the application's message pump.
116 return FALSE;
117 }