int wmain()

in installvoices/InstallVoices.cpp [46:95]


int wmain(int argc, __in_ecount(argc) WCHAR* argv[])
{
	HRESULT hr = S_OK;
	if (argc > 3 || argc < 2)
	{
		PrintHelp(argv[0]);
		hr = E_INVALIDARG;
		//return FAILED(hr);
	} else if (argc > 1)
	{
		CoInitialize(nullptr);

		std::wstring voiceList;
		if (argc == 3) {
			voiceList = argv[2];
		}

		voice_map_t voices = SelectedVoicesMap(voiceList);

		if (wcscmp(argv[1], L"install") == 0)
		{			
			
			for (auto& voice : voices)
			{
				std::wcout << L"Installing " << voice.second.tokenKeyName << " - ";
				std::wcout << voice.second.langIndependentName << std::endl;

				AddVoice(voice.second);
			}						
		}
		else if (wcscmp(argv[1], L"uninstall") == 0)
		{			
			for (auto& voice : voices)
			{
				std::wcout << L"Removing " << voice.second.tokenKeyName << " - ";
				std::wcout << voice.second.langIndependentName << std::endl;

				RemoveVoice(const_cast<WCHAR *>(voice.second.tokenKeyName.c_str()));
			}
		}
		else {
			PrintHelp(argv[0]);
			hr = E_INVALIDARG;
		}

		CoUninitialize();
	}

	return FAILED(hr);
}