]> git.saurik.com Git - apple/mdnsresponder.git/blob - mDNSWindows/DNSServiceBrowser/Windows/Sources/Application.cpp
mDNSResponder-107.6.tar.gz
[apple/mdnsresponder.git] / mDNSWindows / DNSServiceBrowser / Windows / Sources / Application.cpp
1 /* -*- Mode: C; tab-width: 4 -*-
2 *
3 * Copyright (c) 2002-2004 Apple Computer, Inc. All rights reserved.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16
17 Change History (most recent first):
18
19 $Log: Application.cpp,v $
20 Revision 1.3 2006/08/14 23:25:49 cheshire
21 Re-licensed mDNSResponder daemon source code under Apache License, Version 2.0
22
23 Revision 1.2 2004/07/13 21:24:26 rpantos
24 Fix for <rdar://problem/3701120>.
25
26 Revision 1.1 2004/06/18 04:04:36 rpantos
27 Move up one level
28
29 Revision 1.2 2004/01/30 02:56:32 bradley
30 Updated to support full Unicode display. Added support for all services on www.dns-sd.org.
31
32 Revision 1.1 2003/08/21 02:06:47 bradley
33 Moved DNSServiceBrowser for non-Windows CE into Windows sub-folder.
34
35 Revision 1.5 2003/08/12 19:56:28 cheshire
36 Update to APSL 2.0
37
38 Revision 1.4 2003/07/02 21:20:06 cheshire
39 <rdar://problem/3313413> Update copyright notices, etc., in source code comments
40
41 Revision 1.3 2002/09/21 20:44:55 zarzycki
42 Added APSL info
43
44 Revision 1.2 2002/09/20 08:37:34 bradley
45 Increased the DNS record cache from the default of 64 to 512 entries for larger networks.
46
47 Revision 1.1 2002/09/20 06:12:51 bradley
48 DNSServiceBrowser for Windows
49
50 */
51
52 #include <assert.h>
53
54 #include "StdAfx.h"
55
56 #include "DNSServices.h"
57
58 #include "Application.h"
59
60 #include "ChooserDialog.h"
61
62 #include "stdafx.h"
63
64 #ifdef _DEBUG
65 #define new DEBUG_NEW
66 #undef THIS_FILE
67 static char THIS_FILE[] = __FILE__;
68 #endif
69
70 //===========================================================================================================================
71 // Message Map
72 //===========================================================================================================================
73
74 BEGIN_MESSAGE_MAP(Application, CWinApp)
75 //{{AFX_MSG_MAP(Application)
76 // NOTE - the ClassWizard will add and remove mapping macros here.
77 // DO NOT EDIT what you see in these blocks of generated code!
78 //}}AFX_MSG
79 ON_COMMAND(ID_HELP, CWinApp::OnHelp)
80 END_MESSAGE_MAP()
81
82 //===========================================================================================================================
83 // Globals
84 //===========================================================================================================================
85
86 Application gApp;
87
88 //===========================================================================================================================
89 // Application
90 //===========================================================================================================================
91
92 Application::Application( void )
93 {
94 //
95 }
96
97 //===========================================================================================================================
98 // InitInstance
99 //===========================================================================================================================
100
101 BOOL Application::InitInstance()
102 {
103 DNSStatus err;
104
105 // Standard MFC initialization.
106
107 #if( !defined( AFX_DEPRECATED ) )
108 #ifdef _AFXDLL
109 Enable3dControls(); // Call this when using MFC in a shared DLL
110 #else
111 Enable3dControlsStatic(); // Call this when linking to MFC statically
112 #endif
113 #endif
114
115 InitCommonControls();
116
117 // Set up DNS Services.
118
119 err = DNSServicesInitialize( 0, 512 );
120 assert( err == kDNSNoErr );
121
122 // Create the chooser dialog.
123
124 ChooserDialog * dialog;
125
126 m_pMainWnd = NULL;
127 dialog = new ChooserDialog;
128 dialog->Create( IDD_CHOOSER_DIALOG );
129 m_pMainWnd = dialog;
130 dialog->ShowWindow( SW_SHOW );
131
132 return( true );
133 }
134
135 //===========================================================================================================================
136 // ExitInstance
137 //===========================================================================================================================
138
139 int Application::ExitInstance( void )
140 {
141 // Clean up DNS Services.
142
143 DNSServicesFinalize();
144 return( 0 );
145 }