]> git.saurik.com Git - apple/mdnsresponder.git/blob - mDNSWindows/Applications/DNSServiceBrowser/Windows/Sources/Application.cpp
1fb0723f0d2bab40101f9b1910c593db1f6e0d59
[apple/mdnsresponder.git] / mDNSWindows / Applications / 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 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
7 *
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * file.
14 *
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
22 *
23 * @APPLE_LICENSE_HEADER_END@
24
25 Change History (most recent first):
26
27 $Log: Application.cpp,v $
28 Revision 1.2 2004/01/30 02:56:32 bradley
29 Updated to support full Unicode display. Added support for all services on www.dns-sd.org.
30
31 Revision 1.1 2003/08/21 02:06:47 bradley
32 Moved Rendezvous Browser for non-Windows CE into Windows sub-folder.
33
34 Revision 1.5 2003/08/12 19:56:28 cheshire
35 Update to APSL 2.0
36
37 Revision 1.4 2003/07/02 21:20:06 cheshire
38 <rdar://problem/3313413> Update copyright notices, etc., in source code comments
39
40 Revision 1.3 2002/09/21 20:44:55 zarzycki
41 Added APSL info
42
43 Revision 1.2 2002/09/20 08:37:34 bradley
44 Increased the DNS record cache from the default of 64 to 512 entries for larger networks.
45
46 Revision 1.1 2002/09/20 06:12:51 bradley
47 Rendezvous Browser for Windows
48
49 */
50
51 #include <assert.h>
52
53 #include "StdAfx.h"
54
55 #include "DNSServices.h"
56
57 #include "Application.h"
58
59 #include "ChooserDialog.h"
60
61 #include "stdafx.h"
62
63 #ifdef _DEBUG
64 #define new DEBUG_NEW
65 #undef THIS_FILE
66 static char THIS_FILE[] = __FILE__;
67 #endif
68
69 //===========================================================================================================================
70 // Message Map
71 //===========================================================================================================================
72
73 BEGIN_MESSAGE_MAP(Application, CWinApp)
74 //{{AFX_MSG_MAP(Application)
75 // NOTE - the ClassWizard will add and remove mapping macros here.
76 // DO NOT EDIT what you see in these blocks of generated code!
77 //}}AFX_MSG
78 ON_COMMAND(ID_HELP, CWinApp::OnHelp)
79 END_MESSAGE_MAP()
80
81 //===========================================================================================================================
82 // Globals
83 //===========================================================================================================================
84
85 Application gApp;
86
87 //===========================================================================================================================
88 // Application
89 //===========================================================================================================================
90
91 Application::Application( void )
92 {
93 //
94 }
95
96 //===========================================================================================================================
97 // InitInstance
98 //===========================================================================================================================
99
100 BOOL Application::InitInstance()
101 {
102 DNSStatus err;
103
104 // Standard MFC initialization.
105
106 #if( !defined( AFX_DEPRECATED ) )
107 #ifdef _AFXDLL
108 Enable3dControls(); // Call this when using MFC in a shared DLL
109 #else
110 Enable3dControlsStatic(); // Call this when linking to MFC statically
111 #endif
112 #endif
113
114 InitCommonControls();
115
116 // Set up DNS Services.
117
118 err = DNSServicesInitialize( 0, 512 );
119 assert( err == kDNSNoErr );
120
121 // Create the chooser dialog.
122
123 ChooserDialog * dialog;
124
125 m_pMainWnd = NULL;
126 dialog = new ChooserDialog;
127 dialog->Create( IDD_CHOOSER_DIALOG );
128 m_pMainWnd = dialog;
129 dialog->ShowWindow( SW_SHOW );
130
131 return( true );
132 }
133
134 //===========================================================================================================================
135 // ExitInstance
136 //===========================================================================================================================
137
138 int Application::ExitInstance( void )
139 {
140 // Clean up DNS Services.
141
142 DNSServicesFinalize();
143 return( 0 );
144 }