Fixed registry issue discovered by Carl the Great related to file associations to g3d

This commit is contained in:
SoftCoder 2017-02-10 17:15:03 -08:00
parent edd9ae1fca
commit b4a13ae903
1 changed files with 0 additions and 2 deletions

View File

@ -455,7 +455,6 @@ MainWindow::MainWindow( std::pair<string,vector<string> > unitToLoad,
auto_ptr<wchar_t> wstr(Ansi2WideString(appPath.c_str()));
wstring launchApp = wstring(wstr.get()) + L" \"%1\"";
//DWORD len = (DWORD)launchApp.length() + 1;
DWORD len = (launchApp.size() + 1) * sizeof(wchar_t);
RegSetValueEx(keyHandle, NULL, 0, REG_SZ, (PBYTE)launchApp.c_str(), len);
RegCloseKey(keyHandle);
@ -464,7 +463,6 @@ MainWindow::MainWindow( std::pair<string,vector<string> > unitToLoad,
RegCreateKeyEx(HKEY_CURRENT_USER,subKey.c_str(),0, NULL, 0, KEY_ALL_ACCESS, NULL, &keyHandle, &dwDisposition);
//Set the value.
launchApp = L"megaglest.g3d";
//len = (DWORD)launchApp.length() + 1;
len = (launchApp.size() + 1) * sizeof(wchar_t);
RegSetValueEx(keyHandle, NULL, 0, REG_SZ, (PBYTE)launchApp.c_str(), len);
RegCloseKey(keyHandle);