# HG changeset patch # User StephaneLenclud # Date 1360426747 -3600 # Node ID d8eb6be0f3d5e1451b6ed334c06063b032bceb08 # Parent 0b9403db32efffa16b9556f2c28b12e417caa886 Patch to get it to work with OpenHardwareMonitor diff -r 0b9403db32ef -r d8eb6be0f3d5 CSNamedPipe/CSNamedPipe/Program.cs --- a/CSNamedPipe/CSNamedPipe/Program.cs Fri Feb 08 18:40:08 2013 +0100 +++ b/CSNamedPipe/CSNamedPipe/Program.cs Sat Feb 09 17:19:07 2013 +0100 @@ -14,8 +14,8 @@ if (!(processes.Length > 0)) { Process client = new Process(); - client.StartInfo.FileName = @"E:\Dev\SoundGraphAccess\Debug\SoundGraphAccess.exe"; - client.StartInfo.WorkingDirectory = @"E:\Dev\SoundGraphAccess"; + client.StartInfo.FileName = @"D:\Dev\SoundGraphAccess\Debug\SoundGraphAccess.exe"; + client.StartInfo.WorkingDirectory = @"D:\Dev\SoundGraphAccess"; client.Start(); } diff -r 0b9403db32ef -r d8eb6be0f3d5 SoundGraphAccess.cpp --- a/SoundGraphAccess.cpp Fri Feb 08 18:40:08 2013 +0100 +++ b/SoundGraphAccess.cpp Sat Feb 09 17:19:07 2013 +0100 @@ -44,6 +44,7 @@ // BOOL m_bVfdConnected; BOOL m_bLcdConnected; +BOOL m_IsInit=FALSE; // Forward declarations of functions included in this code module: ATOM MyRegisterClass(HINSTANCE hInstance); @@ -121,6 +122,10 @@ OutputDebugString(gTextFirstLine16); //IMON API call need to be done from window thread for some reason SendMessageToServer(KRspPending); + if (!m_IsInit) + { + PostMessage(gWnd,WM_IMON_INIT,0,0); + } PostMessage(gWnd,WM_IMON_DISPLAY_SET_VFD_TEXT,0,0); } else @@ -143,17 +148,18 @@ while (gPipeReceiver==INVALID_HANDLE_VALUE && !gQuit) { OutputDebugStringA("Trying to connect...\n"); - gPipeReceiver=CreateFile(gPipeNameReceiver, GENERIC_READ ,0,NULL,OPEN_EXISTING,FILE_FLAG_OVERLAPPED,NULL); + gPipeReceiver=CreateFile(gPipeNameReceiver, GENERIC_READ ,0,NULL,OPEN_EXISTING,0,NULL); Sleep(1000); } OutputDebugStringA("Read pipe open!\n"); //Now try connecting on our write pipe - gPipeSender=CreateFile(gPipeNameSender, GENERIC_WRITE ,0,NULL,OPEN_EXISTING,FILE_FLAG_OVERLAPPED,NULL); + gPipeSender=CreateFile(gPipeNameSender, GENERIC_WRITE ,0,NULL,OPEN_EXISTING,0,NULL); if (gPipeSender==INVALID_HANDLE_VALUE) { + int err=GetLastError(); OutputDebugStringA("ERROR: Write pipe failure!\n"); - gQuit=TRUE; + //gQuit=TRUE; } else { @@ -275,6 +281,8 @@ case DSPNM_IMON_RESTARTED: strErrMsg = ("iMON Started and Plug-in Mode Inited."); break; case DSPNM_HW_CONNECTED: strErrMsg = ("iMON HW Connected and Plug-in Mode Inited."); break; } + + m_IsInit=TRUE; } // OutputDebugStringA(strErrMsg); @@ -423,6 +431,7 @@ break; case WM_IMON_UNINIT: + m_IsInit=FALSE; IMON_Display_Uninit(); SendMessageToServer(KRspDone); break; diff -r 0b9403db32ef -r d8eb6be0f3d5 SoundGraphAccess.sln --- a/SoundGraphAccess.sln Fri Feb 08 18:40:08 2013 +0100 +++ b/SoundGraphAccess.sln Sat Feb 09 17:19:07 2013 +0100 @@ -1,7 +1,7 @@  -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual Studio 2008 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SoundGraphAccess", "SoundGraphAccess.vcproj", "{A23C5543-181D-41F3-892C-E8A0C7FFFE30}" +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Express 2012 for Windows Desktop +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SoundGraphAccess", "SoundGraphAccess.vcxproj", "{A23C5543-181D-41F3-892C-E8A0C7FFFE30}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution