-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathBridgeLink.cpp
executable file
·608 lines (501 loc) · 19.3 KB
/
BridgeLink.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
///////////////////////////////////////////////////////////////////////
// BridgeLink - BridgeLink Extensible Application Framework
// Copyright © 1999-2025 Washington State Department of Transportation
// Bridge and Structures Office
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the Alternate Route Open Source License as
// published by the Washington State Department of Transportation,
// Bridge and Structures Office.
//
// This program is distributed in the hope that it will be useful, but
// distribution is AS IS, WITHOUT ANY WARRANTY; without even the implied
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
// the Alternate Route Open Source License for more details.
//
// You should have received a copy of the Alternate Route Open Source
// License along with this program; if not, write to the Washington
// State Department of Transportation, Bridge and Structures Office,
// P.O. Box 47340, Olympia, WA 98503, USA or e-mail
///////////////////////////////////////////////////////////////////////
// BridgeLink.cpp : Defines the class behaviors for the application.
//
#include "stdafx.h"
#include <initguid.h>
#include "BridgeLink.h"
#include "AboutDlg.h"
#include "BridgeLinkCATID.h"
#include "BridgeLinkCommandIDs.h"
#include "ScreenSizeDlg.h"
#include "MainFrm.h"
#include "ConfigureBridgeLinkDlg.h"
#include <EAF\EAFDataRecoveryHandler.h>
// This is the range of command IDs for all plug-in commands... all means all commands added
// to the menus of the BridgeLink executable program, the AppPlugin document and view menus,
// and plugin supplied menus, toolbars, and accelerator tables. This is the range of commands
// that non-unique command IDs, provide by external components, get mapped into.
#define BRIDGELINK_FIRST_PLUGIN_COMMAND 0xADFF // the first plugin command will map to this command ID
#define BRIDGELINK_LAST_PLUGIN_COMMAND 0xDFFF // this is the end of the command range that MFC lets us use
#define BRIDGELINK_TOTAL_PLUGIN_COMMAND_COUNT (BRIDGELINK_LAST_PLUGIN_COMMAND-BRIDGELINK_FIRST_PLUGIN_COMMAND) // this is the total number of plug in commands that we will support
// we are reserving 12,800 command IDs for plug-in commands. Assuming each plugin reserves 256 (0x0100) commands, we can support a total of 50 plugins
// BridgeLink itself can accept plug-in commands. We have to carve out a little bit of the range defined above for our use.
#define BRIDGELINK_PLUGIN_COMMAND_COUNT 0x0100 // we'll reserve 256 command IDs for direct BridgeLink plug-in commands
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CBridgeLinkApp
BEGIN_MESSAGE_MAP(CBridgeLinkApp, CEAFPluginApp)
//{{AFX_MSG_MAP(CBridgeLinkApp)
ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
ON_COMMAND(ID_HELP_JOINARPLIST, OnHelpJoinArpList)
ON_COMMAND(ID_HELP_INET_WSDOT, OnHelpInetWsdot)
ON_COMMAND(ID_HELP_INET_BRIDGELINK, OnHelpInetBridgeLink)
ON_COMMAND(ID_HELP_INET_ARP, OnHelpInetARP)
ON_COMMAND(ID_SCREEN_SIZE,OnScreenSize)
ON_COMMAND(ID_HELP,OnHelp)
//}}AFX_MSG_MAP
// Standard file based document commands
// Standard print setup command
ON_COMMAND(ID_FILE_PRINT_SETUP, CWinApp::OnFilePrintSetup)
ON_COMMAND(IDM_CONFIGURE_BRIDGELINK, &CBridgeLinkApp::OnConfigure)
ON_UPDATE_COMMAND_UI(IDM_CONFIGURE_BRIDGELINK,&CBridgeLinkApp::OnConfigureUpdateUI)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CBridgeLinkApp construction
CBridgeLinkApp::CBridgeLinkApp()
{
m_CallbackID = 0;
}
CBridgeLinkApp::~CBridgeLinkApp()
{
}
void CBridgeLinkApp::GetUserInfo(CString* pstrEngineer,CString* pstrCompany)
{
CString strDefaultCompany = GetLocalMachineString(_T("Options"),_T("CompanyName"), _T("Your Company"));
CString strDefaultEngineer = GetLocalMachineString(_T("Options"),_T("EngineerName"),_T("Your Name"));
*pstrEngineer = GetProfileString(_T("Options"),_T("EngineerName"), strDefaultEngineer);
*pstrCompany = GetProfileString(_T("Options"),_T("CompanyName"), strDefaultCompany);
}
void CBridgeLinkApp::SetUserInfo(const CString& strEngineer,const CString& strCompany)
{
VERIFY(WriteProfileString(_T("Options"), _T("EngineerName"), strEngineer));
VERIFY(WriteProfileString(_T("Options"), _T("CompanyName"), strCompany));
}
void CBridgeLinkApp::ConfigureAutoSave()
{
BOOL bAutoSave;
int interval;
GetAutoSaveInfo(&bAutoSave, &interval);
EnableAutoSave(bAutoSave, interval);
}
IDType CBridgeLinkApp::Register(IBridgeLinkConfigurationCallback* pCallback)
{
IDType key = m_CallbackID++;
m_ConfigurationCallbacks.insert(std::make_pair(key,pCallback));
return key;
}
bool CBridgeLinkApp::UnregisterCallback(IDType ID)
{
std::map<IDType,IBridgeLinkConfigurationCallback*>::iterator found = m_ConfigurationCallbacks.find(ID);
if ( found == m_ConfigurationCallbacks.end() )
{
return false;
}
m_ConfigurationCallbacks.erase(found);
return true;
}
void CBridgeLinkApp::OnFirstRun()
{
Configure();
}
void CBridgeLinkApp::OnConfigureUpdateUI(CCmdUI* pCmdUI)
{
pCmdUI->Enable(m_ConfigurationCallbacks.size() != 0);
}
void CBridgeLinkApp::Configure()
{
// Can't configure if there are other instances of bridgelink running. This avoids race condition on libraries and templates
if (EAFAreOtherProgramInstancesRunning())
{
::AfxMessageBox(_T("BridgeLink cannot be configured at this time because other running instances of the BridgeLink application have been detected. Please close all other open BridgeLink applications and try again."),MB_OK | MB_ICONEXCLAMATION);
}
else
{
CConfigureBridgeLinkDlg dlg(m_ConfigurationCallbacks);
GetUserInfo(&dlg.m_BridgeLinkPage.m_strEngineer,&dlg.m_BridgeLinkPage.m_strCompany);
GetAutoSaveInfo(&dlg.m_BridgeLinkPage.m_bAutoSave,&dlg.m_BridgeLinkPage.m_AutoSaveInterval);
// autosave interval is in milliseconds, we want it in minutes
dlg.m_BridgeLinkPage.m_AutoSaveInterval /= 60000;
INT_PTR results = dlg.DoModal();
if (results == IDOK)
{
SetUserInfo(dlg.m_BridgeLinkPage.m_strEngineer,dlg.m_BridgeLinkPage.m_strCompany);
SaveAutoSaveInfo(dlg.m_BridgeLinkPage.m_bAutoSave,dlg.m_BridgeLinkPage.m_AutoSaveInterval * 60000);
ConfigureAutoSave();
}
}
}
/////////////////////////////////////////////////////////////////////////////
// The one and only CBridgeLinkApp object
CBridgeLinkApp theApp;
/////////////////////////////////////////////////////////////////////////////
// CBridgeLinkApp initialization
CString CBridgeLinkApp::GetProductCode()
{
// Return the Product Code from InstallShield
// This code uniquely identifies BridgeLink so do not change it
#if defined _WIN64
return "{88563058-642A-455E-9001-A0BD8B71A793}";
#else
return "{E95DA66F-6C17-48D1-8B16-40EAB5D2424C}";
#endif
}
CString CBridgeLinkApp::GetDocumentationRootLocation()
{
if ( UseOnlineDocumentation() )
{
// NOTE: The following approach allows third party distributers to use their own server for documentation.
// Their installer should write the documentation root location to HKLM\Settings\DocumentationRoot.
// This value will be the default when the documenation root setting is read for a specific user from HKCU\Settings\DocumentationRoot
// If the HKCU value isn't found, the default from HKLM is used.
// Get the default location for the documentation root from the local machine registry hive
// If not present, use the WSDOT location
CString strDefaultDocumentationRootLocation = GetLocalMachineString(_T("Settings"),_T("DocumentationRoot"), _T("https://www.wsdot.wa.gov/eesc/bridge/software/Documentation/"));
// Get the user's setting, using the local machine setting as the default if not present
CString strDocumentationRootLocation = GetProfileString(_T("Settings"),_T("DocumentationRoot"),strDefaultDocumentationRootLocation);
return strDocumentationRootLocation;
}
else
{
CString str(GetAppLocation());
#if defined _DEBUG
#if defined _WIN64
str.Replace(_T("RegFreeCOM\\x64\\Debug\\"),_T(""));
#else
str.Replace(_T("RegFreeCOM\\Win32\\Debug\\"),_T(""));
#endif
#else
// in a real release, the path doesn't contain RegFreeCOM\\Release, but that's
// ok... the replace will fail and the string wont be altered.
#if defined _WIN64
str.Replace(_T("RegFreeCOM\\x64\\Release\\"),_T(""));
#else
str.Replace(_T("RegFreeCOM\\Win32\\Release\\"),_T(""));
#endif
#endif
CString strLocation;
strLocation.Format(_T("%sDocs\\"),str);
return strLocation;
}
}
LPCTSTR CBridgeLinkApp::GetRegistryKey()
{
return _T("Washington State Department of Transportation");
}
LPCTSTR CBridgeLinkApp::GetAppPluginCategoryName()
{
return _T("BridgeLink Application Plugin");
}
CATID CBridgeLinkApp::GetAppPluginCategoryID()
{
return CATID_BridgeLinkAppPlugin;
}
LPCTSTR CBridgeLinkApp::GetPluginCategoryName()
{
return _T("BridgeLink Plugin");
}
CATID CBridgeLinkApp::GetPluginCategoryID()
{
return CATID_BridgeLinkPlugin;
}
void CBridgeLinkApp::ProcessCommandLineOptions(CEAFCommandLineInfo& cmdInfo)
{
// disable AutoSave when processing command line options
EnableAutoSave(false, 0);
__super::ProcessCommandLineOptions(cmdInfo);
}
CEAFSplashScreenInfo CBridgeLinkApp::GetSplashScreenInfo()
{
CBitmap bmp;
CEAFSplashScreenInfo info;
VERIFY(bmp.LoadBitmap(IDB_SPLASH));
info.m_hBitmap = bmp;
info.m_TextColor = WHITE; // color of the information text drawn onto the splash screen
info.m_TextFormat = DT_TOP | DT_LEFT | DT_SINGLELINE | DT_MODIFYSTRING | DT_END_ELLIPSIS | DT_WORDBREAK;
info.m_TextRect = CRect(120,110,515,315); // rectangle on the splash screen bitmap where text is written
bmp.Detach();
return info;
}
CMDIFrameWnd* CBridgeLinkApp::CreateMainFrame()
{
// don't call base class, the functionality is being replaced
CMainFrame* pMainFrame = new CMainFrame;
if (!pMainFrame->LoadFrame(IDR_MAINFRAME))
{
delete pMainFrame;
return nullptr;
}
// files can be opened with drag and drop
pMainFrame->DragAcceptFiles(TRUE);
return pMainFrame;
}
CATID CBridgeLinkApp::GetComponentInfoCategoryID()
{
return CATID_BridgeLinkComponentInfo;
}
BOOL CBridgeLinkApp::InitInstance()
{
#if defined _DEBUG
//_crtBreakAlloc = 31589; // causes program to break at a specific memory allocation
#endif
// Tip of the Day
// Get the names of all the *.tip files in the application folder
std::vector<CString> strTipFiles;
CFileFind finder;
CString str(GetAppLocation());
#if defined _DEBUG
#if defined _WIN64
str.Replace(_T("RegFreeCOM\\x64\\Debug\\"),_T(""));
#else
str.Replace(_T("RegFreeCOM\\Win32\\Debug\\"),_T(""));
#endif
#else
// in a real release, the path doesn't contain RegFreeCOM\\Release, but that's
// ok... the replace will fail and the string wont be altered.
#if defined _WIN64
str.Replace(_T("RegFreeCOM\\x64\\Release\\"),_T(""));
#else
str.Replace(_T("RegFreeCOM\\Win32\\Release\\"),_T(""));
#endif
#endif
str += CString(_T("*.tip"));
BOOL bWorking = finder.FindFile(str);
while ( bWorking )
{
bWorking = finder.FindNextFile();
CString strTipFile = finder.GetFilePath();
strTipFiles.push_back(strTipFile);
}
EnableTipOfTheDay(strTipFiles);
// Reserve the total range of command IDs that can be used for ALL BridgeLink App Plugins.
// ALL means all commands added to the menus of the main executable, the
// EAFAppPlugin document and view menus, and plugin supplied menus,
// toolbars, and accelerator tables
CEAFPluginCommandManager::ReserveTotalCommandIDRange(BRIDGELINK_FIRST_PLUGIN_COMMAND,BRIDGELINK_LAST_PLUGIN_COMMAND);
// Reserve BRIDGELINK_PLUGIN_COMMAND_COUNT command IDs for commands that get added
// to the main application
UINT nCommands = GetPluginCommandManager()->ReserveCommandIDRange(BRIDGELINK_PLUGIN_COMMAND_COUNT);
ATLASSERT(nCommands == BRIDGELINK_PLUGIN_COMMAND_COUNT);
// user can dbl-click on a file to open
EnableShellOpen();
if ( !CEAFPluginApp::InitInstance() )
{
return FALSE;
}
// Must be done after call to base class InitInstance because OLE has not been
// initialized yet.
//WBFL::System::ComCatMgr::CreateCategory(_T("BridgeLink Application Plugin"),CATID_BridgeLinkAppPlugin); // this is done by the base class
WBFL::System::ComCatMgr::CreateCategory(_T("BridgeLink Components"),CATID_BridgeLinkComponentInfo);
// Need to let drag and drop messages through
// See https://helgeklein.com/blog/2010/03/how-to-enable-drag-and-drop-for-an-elevated-mfc-application-on-vistawindows-7/
::ChangeWindowMessageFilter(WM_DROPFILES,MSGFLT_ADD);
::ChangeWindowMessageFilter(WM_COPYDATA, MSGFLT_ADD);
::ChangeWindowMessageFilter(0x0049, MSGFLT_ADD);
ConfigureAutoSave();
return TRUE;
}
int CBridgeLinkApp::ExitInstance()
{
return CEAFApp::ExitInstance();
}
/////////////////////////////////////////////////////////////////////////////
// CBridgeLinkApp message handlers
/////////////////////////////////////////////////////////////////////////////
// CBridgeLinkApp commands
CString CBridgeLinkApp::GetVersion(bool bIncludeBuildNumber) const
{
CString strExe( m_pszExeName );
strExe += _T(".exe");
CVersionInfo verInfo;
verInfo.Load(strExe);
#if defined _DEBUG || defined _BETA_VERSION
// always include the build number in debug and beta versions
bIncludeBuildNumber = true;
#endif
CString strVersion = verInfo.GetProductVersionAsString(bIncludeBuildNumber);
return strVersion;
}
CString CBridgeLinkApp::GetVersionString(bool bIncludeBuildNumber) const
{
CString str(_T("Version "));
str += GetVersion(bIncludeBuildNumber);
#if defined _BETA_VERSION
str += CString(_T(" BETA"));
#endif
str += CString(_T(" - Built on "));
str += CString(__DATE__);
return str;
}
void CBridgeLinkApp::RegistryInit()
{
// Application wide settings go under BridgeLink
// Each application plug in will create it's own hive in the registry
// We need to tweek the name here because this is actually the BridgeLink.exe
free((void*)m_pszProfileName);
m_pszProfileName = _tcsdup(_T("BridgeLink"));
CEAFPluginApp::RegistryInit();
// In CEAFApp::InitInstance, RegistryInit() is called before the help window is created
// so this is an excellent location to set the value.
CString strDefaultHelpWindow = GetProfileString(_T("Settings"), _T("UseBuiltinHelpWindow"), _T("No"));
m_bUseHelpWindow = (strDefaultHelpWindow.CompareNoCase(_T("No")) == 0) ? FALSE : TRUE;
}
void CBridgeLinkApp::RegistryExit()
{
WriteProfileString(_T("Settings"), _T("UseBuiltinHelpWindow"), m_bUseHelpWindow ? _T("Yes") : _T("No"));
CEAFPluginApp::RegistryExit();
}
void CBridgeLinkApp::OnScreenSize()
{
CEAFMainFrame* pFrame = EAFGetMainFrame();
CScreenSizeDlg dlg;
CRect rClient;
pFrame->GetWindowRect(&rClient);
dlg.m_Height = rClient.Height();
dlg.m_Width = rClient.Width();
if ( dlg.DoModal() == IDOK )
{
int cx = dlg.m_Width;
int cy = dlg.m_Height;
pFrame->SetWindowPos(nullptr,0,0,cx,cy,SWP_NOMOVE | SWP_NOZORDER);
}
}
void CBridgeLinkApp::OnHelp()
{
// do nothing... just need this so MFC doesn't hide help buttns
}
CString CBridgeLinkApp::GetWsdotUrl()
{
// CString url = GetProfileString(_T("Settings"), _T("WsdotUrl"), _T("https://www.wsdot.wa.gov"));
CString strDefault(_T("https://www.wsdot.wa.gov"));
HKEY key;
LONG result = ::RegOpenKeyEx(HKEY_LOCAL_MACHINE,_T("SOFTWARE\\Washington State Department of Transportation\\BridgeLink\\Settings"),0,KEY_QUERY_VALUE,&key);
if ( result != ERROR_SUCCESS )
{
return strDefault;
}
TCHAR url[MAX_PATH];
DWORD size = MAX_PATH;
DWORD type;
result = ::RegQueryValueEx(key,_T("WsdotUrl"),0,&type,(LPBYTE)&url[0],&size);
if ( result != ERROR_SUCCESS )
{
return strDefault;
}
::RegCloseKey(key);
return url;
}
CString CBridgeLinkApp::GetWsdotBridgeUrl()
{
// CString url = GetProfileString(_T("Settings"), _T("WsdotBridgeUrl"), _T("https://www.wsdot.wa.gov/eesc/bridge"));
CString strDefault(_T("https://www.wsdot.wa.gov/eesc/bridge"));
HKEY key;
LONG result = ::RegOpenKeyEx(HKEY_LOCAL_MACHINE,_T("SOFTWARE\\Washington State Department of Transportation\\BridgeLink\\Settings"),0,KEY_QUERY_VALUE,&key);
if ( result != ERROR_SUCCESS )
{
return strDefault;
}
TCHAR url[MAX_PATH];
DWORD size = MAX_PATH;
DWORD type;
result = ::RegQueryValueEx(key,_T("WsdotBridgeUrl"),0,&type,(LPBYTE)&url[0],&size);
if ( result != ERROR_SUCCESS )
{
return strDefault;
}
::RegCloseKey(key);
return url;
}
CString CBridgeLinkApp::GetBridgeLinkUrl()
{
CString strDefault(_T("https://www.wsdot.wa.gov/eesc/bridge/software/index.cfm?fuseaction=software_detail&software_id=69"));
HKEY key;
LONG result = ::RegOpenKeyEx(HKEY_LOCAL_MACHINE,_T("SOFTWARE\\Washington State Department of Transportation\\BridgeLink\\Settings"),0,KEY_QUERY_VALUE,&key);
if ( result != ERROR_SUCCESS )
{
return strDefault;
}
TCHAR url[MAX_PATH];
DWORD size = MAX_PATH;
DWORD type;
result = ::RegQueryValueEx(key,_T("BridgeLinkUrl"),0,&type,(LPBYTE)&url[0],&size);
if ( result != ERROR_SUCCESS )
{
return strDefault;
}
::RegCloseKey(key);
return url;
}
void CBridgeLinkApp::OnHelpInetWsdot()
{
HINSTANCE hInstance = ::ShellExecute(m_pMainWnd->GetSafeHwnd(),
_T("open"),
GetWsdotUrl(),
0,0,SW_SHOWDEFAULT);
if ( hInstance <= (HINSTANCE)HINSTANCE_ERROR )
{
AfxMessageBox(IDS_E_ONLINERESOURCES);
}
}
void CBridgeLinkApp::OnHelpJoinArpList()
{
HINSTANCE hInstance = ::ShellExecute(m_pMainWnd->GetSafeHwnd(),
_T("open"),
_T("https://www.pgsuper.com/content/forum"),
0,0,SW_SHOWDEFAULT);
if ( hInstance <= (HINSTANCE)HINSTANCE_ERROR)
{
AfxMessageBox(IDS_E_ONLINERESOURCES);
}
}
void CBridgeLinkApp::OnHelpInetARP()
{
HINSTANCE hInstance = ::ShellExecute(m_pMainWnd->GetSafeHwnd(),
_T("open"),
_T("https://wsdot.wa.gov/eesc/bridge/alternateroute"),
0,0,SW_SHOWDEFAULT);
if ( hInstance <= (HINSTANCE)HINSTANCE_ERROR )
{
AfxMessageBox(IDS_E_ONLINERESOURCES);
}
}
void CBridgeLinkApp::OnHelpInetBridgeLink()
{
HINSTANCE hInstance = ::ShellExecute(m_pMainWnd->GetSafeHwnd(),
_T("open"),
GetBridgeLinkUrl(),
0,0,SW_SHOWDEFAULT);
if ( hInstance <= (HINSTANCE)HINSTANCE_ERROR )
{
AfxMessageBox(IDS_E_ONLINERESOURCES);
}
}
// App command to run the dialog
void CBridgeLinkApp::OnAppAbout()
{
CAboutDlg dlg;
dlg.DoModal();
}
BOOL CBridgeLinkApp::OnCmdMsg(UINT nID,int nCode,void* pExtra,AFX_CMDHANDLERINFO* pHandlerInfo)
{
// For some reason, this method is needed otherwise the base class version
// doesn't get called... even though the base class method is virtual
return CEAFPluginApp::OnCmdMsg(nID,nCode,pExtra,pHandlerInfo);
}
void CBridgeLinkApp::OnConfigure()
{
Configure();
}