]> git.saurik.com Git - apple/mdnsresponder.git/blob - mDNSWindows/DNSServiceBrowser/Windows/Sources/Application.cpp
mDNSResponder-87.tar.gz
[apple/mdnsresponder.git] / mDNSWindows / DNSServiceBrowser / Windows / Sources / Application.cpp
1 /*
2 * Copyright (c) 2002-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: Application.cpp,v $
26 Revision 1.2 2004/07/13 21:24:26 rpantos
27 Fix for <rdar://problem/3701120>.
28
29 Revision 1.1 2004/06/18 04:04:36 rpantos
30 Move up one level
31
32 Revision 1.2 2004/01/30 02:56:32 bradley
33 Updated to support full Unicode display. Added support for all services on www.dns-sd.org.
34
35 Revision 1.1 2003/08/21 02:06:47 bradley
36 Moved DNSServiceBrowser for non-Windows CE into Windows sub-folder.
37
38 Revision 1.5 2003/08/12 19:56:28 cheshire
39 Update to APSL 2.0
40
41 Revision 1.4 2003/07/02 21:20:06 cheshire
42 <rdar://problem/3313413> Update copyright notices, etc., in source code comments
43
44 Revision 1.3 2002/09/21 20:44:55 zarzycki
45 Added APSL info
46
47 Revision 1.2 2002/09/20 08:37:34 bradley
48 Increased the DNS record cache from the default of 64 to 512 entries for larger networks.
49
50 Revision 1.1 2002/09/20 06:12:51 bradley
51 DNSServiceBrowser for Windows
52
53 */
54
55 #include <assert.h>
56
57 #include "StdAfx.h"
58
59 #include "DNSServices.h"
60
61 #include "Application.h"
62
63 #include "ChooserDialog.h"
64
65 #include "stdafx.h"
66
67 #ifdef _DEBUG
68 #define new DEBUG_NEW
69 #undef THIS_FILE
70 static char THIS_FILE[] = __FILE__;
71 #endif
72
73 //===========================================================================================================================
74 // Message Map
75 //===========================================================================================================================
76
77 BEGIN_MESSAGE_MAP(Application, CWinApp)
78 //{{AFX_MSG_MAP(Application)
79 // NOTE - the ClassWizard will add and remove mapping macros here.
80 // DO NOT EDIT what you see in these blocks of generated code!
81 //}}AFX_MSG
82 ON_COMMAND(ID_HELP, CWinApp::OnHelp)
83 END_MESSAGE_MAP()
84
85 //===========================================================================================================================
86 // Globals
87 //===========================================================================================================================
88
89 Application gApp;
90
91 //===========================================================================================================================
92 // Application
93 //===========================================================================================================================
94
95 Application::Application( void )
96 {
97 //
98 }
99
100 //===========================================================================================================================
101 // InitInstance
102 //===========================================================================================================================
103
104 BOOL Application::InitInstance()
105 {
106 DNSStatus err;
107
108 // Standard MFC initialization.
109
110 #if( !defined( AFX_DEPRECATED ) )
111 #ifdef _AFXDLL
112 Enable3dControls(); // Call this when using MFC in a shared DLL
113 #else
114 Enable3dControlsStatic(); // Call this when linking to MFC statically
115 #endif
116 #endif
117
118 InitCommonControls();
119
120 // Set up DNS Services.
121
122 err = DNSServicesInitialize( 0, 512 );
123 assert( err == kDNSNoErr );
124
125 // Create the chooser dialog.
126
127 ChooserDialog * dialog;
128
129 m_pMainWnd = NULL;
130 dialog = new ChooserDialog;
131 dialog->Create( IDD_CHOOSER_DIALOG );
132 m_pMainWnd = dialog;
133 dialog->ShowWindow( SW_SHOW );
134
135 return( true );
136 }
137
138 //===========================================================================================================================
139 // ExitInstance
140 //===========================================================================================================================
141
142 int Application::ExitInstance( void )
143 {
144 // Clean up DNS Services.
145
146 DNSServicesFinalize();
147 return( 0 );
148 }