Browse Source

if device isn't available then don' t send a close

git-svn-id: svn://svn.code.sf.net/p/ditto-cp/code/trunk@359 595ec19a-5cb4-439b-94a8-42fb3063c22c
sabrogden 19 years ago
parent
commit
9b1e0ed739
1 changed files with 5 additions and 0 deletions
  1. 5 0
      U3Stop/U3Start.cpp

+ 5 - 0
U3Stop/U3Start.cpp

@@ -24,6 +24,11 @@ BOOL CU3StartApp::InitInstance()
 {
 {
 	CWinApp::InitInstance();
 	CWinApp::InitInstance();
 
 
+	//if the device isn't available then just return, u3action will kill the process
+	CString csAvailable = getenv("U3_IS_DEVICE_AVAILABLE");
+	if(csAvailable != "true")
+		return FALSE;
+
 	//Load the ini file in the same dir as this is running
 	//Load the ini file in the same dir as this is running
 	CString sExeName;
 	CString sExeName;
 	GetModuleFileName(NULL, sExeName.GetBuffer(_MAX_PATH),_MAX_PATH);
 	GetModuleFileName(NULL, sExeName.GetBuffer(_MAX_PATH),_MAX_PATH);