Patch to get it to work with OpenHardwareMonitor
authorStephaneLenclud
Sat, 09 Feb 2013 17:19:07 +0100
changeset 5d8eb6be0f3d5
parent 4 0b9403db32ef
child 6 f1413622948f
Patch to get it to work with OpenHardwareMonitor
CSNamedPipe/CSNamedPipe/Program.cs
SoundGraphAccess.cpp
SoundGraphAccess.sln
     1.1 --- a/CSNamedPipe/CSNamedPipe/Program.cs	Fri Feb 08 18:40:08 2013 +0100
     1.2 +++ b/CSNamedPipe/CSNamedPipe/Program.cs	Sat Feb 09 17:19:07 2013 +0100
     1.3 @@ -14,8 +14,8 @@
     1.4              if (!(processes.Length > 0))
     1.5              {
     1.6                  Process client = new Process();
     1.7 -                client.StartInfo.FileName = @"E:\Dev\SoundGraphAccess\Debug\SoundGraphAccess.exe";
     1.8 -                client.StartInfo.WorkingDirectory = @"E:\Dev\SoundGraphAccess";
     1.9 +                client.StartInfo.FileName = @"D:\Dev\SoundGraphAccess\Debug\SoundGraphAccess.exe";
    1.10 +                client.StartInfo.WorkingDirectory = @"D:\Dev\SoundGraphAccess";
    1.11                  client.Start();
    1.12              }
    1.13  
     2.1 --- a/SoundGraphAccess.cpp	Fri Feb 08 18:40:08 2013 +0100
     2.2 +++ b/SoundGraphAccess.cpp	Sat Feb 09 17:19:07 2013 +0100
     2.3 @@ -44,6 +44,7 @@
     2.4  //
     2.5  BOOL m_bVfdConnected;
     2.6  BOOL m_bLcdConnected;
     2.7 +BOOL m_IsInit=FALSE;
     2.8  
     2.9  // Forward declarations of functions included in this code module:
    2.10  ATOM				MyRegisterClass(HINSTANCE hInstance);
    2.11 @@ -121,6 +122,10 @@
    2.12  		OutputDebugString(gTextFirstLine16);
    2.13  		//IMON API call need to be done from window thread for some reason
    2.14  		SendMessageToServer(KRspPending);
    2.15 +		if (!m_IsInit)
    2.16 +			{
    2.17 +			PostMessage(gWnd,WM_IMON_INIT,0,0);		
    2.18 +			}
    2.19  		PostMessage(gWnd,WM_IMON_DISPLAY_SET_VFD_TEXT,0,0);		
    2.20  		}
    2.21  	else
    2.22 @@ -143,17 +148,18 @@
    2.23  	while (gPipeReceiver==INVALID_HANDLE_VALUE && !gQuit)
    2.24  		{
    2.25  		OutputDebugStringA("Trying to connect...\n");
    2.26 -		gPipeReceiver=CreateFile(gPipeNameReceiver,	GENERIC_READ ,0,NULL,OPEN_EXISTING,FILE_FLAG_OVERLAPPED,NULL);
    2.27 +		gPipeReceiver=CreateFile(gPipeNameReceiver,	GENERIC_READ ,0,NULL,OPEN_EXISTING,0,NULL);
    2.28  		Sleep(1000);
    2.29  		}
    2.30  	
    2.31  	OutputDebugStringA("Read pipe open!\n");
    2.32  	//Now try connecting on our write pipe
    2.33 -	gPipeSender=CreateFile(gPipeNameSender,	GENERIC_WRITE ,0,NULL,OPEN_EXISTING,FILE_FLAG_OVERLAPPED,NULL);
    2.34 +	gPipeSender=CreateFile(gPipeNameSender,	GENERIC_WRITE ,0,NULL,OPEN_EXISTING,0,NULL);
    2.35  	if (gPipeSender==INVALID_HANDLE_VALUE)
    2.36  		{
    2.37 +		int err=GetLastError();
    2.38  		OutputDebugStringA("ERROR: Write pipe failure!\n");
    2.39 -		gQuit=TRUE;
    2.40 +		//gQuit=TRUE;
    2.41  		}
    2.42  	else
    2.43  		{
    2.44 @@ -275,6 +281,8 @@
    2.45  			case DSPNM_IMON_RESTARTED:		strErrMsg = ("iMON Started and Plug-in Mode Inited.");		break;
    2.46  			case DSPNM_HW_CONNECTED:		strErrMsg = ("iMON HW Connected and Plug-in Mode Inited.");	break;
    2.47  			}
    2.48 +
    2.49 +		m_IsInit=TRUE;
    2.50  		}
    2.51  	//
    2.52  	OutputDebugStringA(strErrMsg);
    2.53 @@ -423,6 +431,7 @@
    2.54  		break;
    2.55  
    2.56  	case WM_IMON_UNINIT:
    2.57 +		m_IsInit=FALSE;
    2.58  		IMON_Display_Uninit();
    2.59  		SendMessageToServer(KRspDone);
    2.60  		break;
     3.1 --- a/SoundGraphAccess.sln	Fri Feb 08 18:40:08 2013 +0100
     3.2 +++ b/SoundGraphAccess.sln	Sat Feb 09 17:19:07 2013 +0100
     3.3 @@ -1,7 +1,7 @@
     3.4  
     3.5 -Microsoft Visual Studio Solution File, Format Version 10.00
     3.6 -# Visual Studio 2008
     3.7 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SoundGraphAccess", "SoundGraphAccess.vcproj", "{A23C5543-181D-41F3-892C-E8A0C7FFFE30}"
     3.8 +Microsoft Visual Studio Solution File, Format Version 12.00
     3.9 +# Visual Studio Express 2012 for Windows Desktop
    3.10 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SoundGraphAccess", "SoundGraphAccess.vcxproj", "{A23C5543-181D-41F3-892C-E8A0C7FFFE30}"
    3.11  EndProject
    3.12  Global
    3.13  	GlobalSection(SolutionConfigurationPlatforms) = preSolution