[Mobies-commit] [commit] r3875 - UDM/trunk/src/UIntWizVS/Templates/1033

ksmyth at redhat1.isis.vanderbilt.edu ksmyth at redhat1.isis.vanderbilt.edu
Wed Sep 7 10:39:59 CDT 2011


Author: ksmyth
Date: Wed Sep  7 10:39:58 2011
New Revision: 3875

Log:
Fix some COM errors

Modified:
   UDM/trunk/src/UIntWizVS/Templates/1033/UdmConsole.cpp

Modified: UDM/trunk/src/UIntWizVS/Templates/1033/UdmConsole.cpp
==============================================================================
--- UDM/trunk/src/UIntWizVS/Templates/1033/UdmConsole.cpp	Mon Aug 29 14:32:53 2011	(r3874)
+++ UDM/trunk/src/UIntWizVS/Templates/1033/UdmConsole.cpp	Wed Sep  7 10:39:58 2011	(r3875)
@@ -11,18 +11,20 @@
 	{
 		CComPtr<IMgaClient> client;	
 		CComQIPtr<IDispatch> pDispatch;
-		HRESULT s1 = project->GetClientByName(L"GME.Application",&client);
+		HRESULT s1 = project->GetClientByName(CComBSTR(L"GME.Application"),&client);
 
 		if ((SUCCEEDED(s1)) && (client != 0))
 		{
 			HRESULT s2 = client->get_OLEServer(&pDispatch);
 			if ((SUCCEEDED(s2)) && (pDispatch != 0))
 			{
+				// release here in case setupConsole was called twice
+				gmeoleapp.Release();
 				HRESULT s3 = pDispatch->QueryInterface(&gmeoleapp);
 				if ((SUCCEEDED(s3)) && (gmeoleapp != 0))
 				{
 					// gmeoleapp->ConsoleClear();
-					gmeoleapp->put_ConsoleContents(L"");
+					gmeoleapp->put_ConsoleContents(NULL);
 				}
 				else
 				{


More information about the Mobies-commit mailing list