Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Core Temp Shared Memory in Qt C++ - Windows
Forum Updated to NodeBB v4.3 + New Features

Core Temp Shared Memory in Qt C++ - Windows

Scheduled Pinned Locked Moved Solved General and Desktop
27 Posts 4 Posters 4.3k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Ryan R
    wrote on last edited by Ryan R
    #8

    I'm literally just using "qDebug() << "\n\n\nTest: " << QString::number(ct.fTemp[1]);" at the moment to get output, then the idea is I'd just store it in a QString, then setText on a label GUI object.

     CORE_TEMP_SHARED_DATA ct;
     qDebug() << "\n\n\nTest: " << QString::number(ct.fTemp[1]);
    
    1 Reply Last reply
    0
    • VRoninV Offline
      VRoninV Offline
      VRonin
      wrote on last edited by VRonin
      #9

      That's just because ct is uninitialised you need to call the function that fills it with data.

      CoreTempSharedDataEx ct;
      fnGetCoreTempInfo(&ct);
      qDebug() << "\n\n\nTest: " << QString::number(ct.fTemp[1]);
      

      P.S.
      I see you are still using CORE_TEMP_SHARED_DATA. As mentioned you should get rid of everyting in your program that comes from the "tutorial" link you psted above

      "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
      ~Napoleon Bonaparte

      On a crusade to banish setIndexWidget() from the holy land of Qt

      1 Reply Last reply
      3
      • R Offline
        R Offline
        Ryan R
        wrote on last edited by
        #10

        Thanks for the help! That makes sense now; before it was just creating the structure without any data.

        I replaced "CORE_TEMP_SHARED_DATA ct;" with "CoreTempSharedDataEx ct;", but it's apparently an unknown type name. However, "fnGetCoreTempInfo(&ct)" seems to be recongised at least.

        The compiler output for CoreTempSharedDataEx is below; it keeps suggesting I use core_temp_shared_data. But if I do, "fnGetCoreTempInfo(&ct);" is no longer recognised.

        17:33:41: Running steps for project QtCoreTempTest...
        17:33:41: Configuration unchanged, skipping qmake step.
        17:33:41: Starting: "E:\Qt\Tools\mingw730_32\bin\mingw32-make.exe" -j8
        E:/Qt/Tools/mingw730_32/bin/mingw32-make -f Makefile.Debug
        mingw32-make[1]: Entering directory 'C:/Users/ariie/Desktop/Qt Programming/QtCoreTempTest/build-QtCoreTempTest-Desktop_Qt_5_14_2_MinGW_32_bit-Debug'
        g++ -c -fno-keep-inline-dllexport -g -std=gnu++11 -Wall -Wextra -Wextra -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I..\..\..\QtProgramming\QtCoreTempTest\QtCoreTempTest -I. -IC:\CoreTempLib -IE:\Qt\5.14.2\mingw73_32\include -IE:\Qt\5.14.2\mingw73_32\include\QtWidgets -IE:\Qt\5.14.2\mingw73_32\include\QtGui -IE:\Qt\5.14.2\mingw73_32\include\QtANGLE -IE:\Qt\5.14.2\mingw73_32\include\QtCore -Idebug -I. -IE:\Qt\5.14.2\mingw73_32\mkspecs\win32-g++  -o debug\mainwindow.o ..\..\..\QtProgramming\QtCoreTempTest\QtCoreTempTest\mainwindow.cpp
        ..\..\..\QtProgramming\QtCoreTempTest\QtCoreTempTest\mainwindow.cpp: In constructor 'MainWindow::MainWindow(QWidget*)':
        ..\..\..\QtProgramming\QtCoreTempTest\QtCoreTempTest\mainwindow.cpp:12:5: error: 'CoreTempSharedDataEx' was not declared in this scope
             CoreTempSharedDataEx ct;
             ^~~~~~~~~~~~~~~~~~~~
        ..\..\..\QtProgramming\QtCoreTempTest\QtCoreTempTest\mainwindow.cpp:12:5: note: suggested alternative: 'core_temp_shared_data'
             CoreTempSharedDataEx ct;
             ^~~~~~~~~~~~~~~~~~~~
             core_temp_shared_data
        ..\..\..\QtProgramming\QtCoreTempTest\QtCoreTempTest\mainwindow.cpp:13:23: error: cannot bind non-const lvalue reference of type 'CORE_TEMP_SHARED_DATA*& {aka core_temp_shared_data*&}' to an rvalue of type 'CORE_TEMP_SHARED_DATA* {aka core_temp_shared_data*}'
             fnGetCoreTempInfo(&ct);
                               ^~~
        In file included from ..\..\..\QtProgramming\QtCoreTempTest\QtCoreTempTest\mainwindow.h:7:0,
                         from ..\..\..\QtProgramming\QtCoreTempTest\QtCoreTempTest\mainwindow.cpp:1:
        C:\CoreTempLib/GetCoreTempinfo.h:27:26: note:   initializing argument 1 of 'bool fnGetCoreTempInfo(CORE_TEMP_SHARED_DATA*&)'
         bool GETCORETEMPINFO_API fnGetCoreTempInfo(CORE_TEMP_SHARED_DATA *&pData);
                                  ^~~~~~~~~~~~~~~~~
        mingw32-make[1]: *** [Makefile.Debug:472: debug/mainwindow.o] Error 1
        mingw32-make[1]: Leaving directory 'C:/Users/ariie/Desktop/Qt Programming/QtCoreTempTest/build-QtCoreTempTest-Desktop_Qt_5_14_2_MinGW_32_bit-Debug'
        mingw32-make: *** [Makefile:45: debug] Error 2
        17:33:45: The process "E:\Qt\Tools\mingw730_32\bin\mingw32-make.exe" exited with code 2.
        Error while building/deploying project QtCoreTempTest (kit: Desktop Qt 5.14.2 MinGW 32-bit)
        When executing step "Make"
        17:33:45: Elapsed time: 00:05.
        

        However, if I use "CORE_TEMP_SHARED_DATA ct;" with "fnGetCoreTempInfo(&ct);", I get the following:

        17:48:36: Running steps for project QtCoreTempTest...
        17:48:36: Configuration unchanged, skipping qmake step.
        17:48:36: Starting: "E:\Qt\Tools\mingw730_32\bin\mingw32-make.exe" -j8
        E:/Qt/Tools/mingw730_32/bin/mingw32-make -f Makefile.Debug
        mingw32-make[1]: Entering directory 'C:/Users/ariie/Desktop/Qt Programming/QtCoreTempTest/build-QtCoreTempTest-Desktop_Qt_5_14_2_MinGW_32_bit-Debug'
        g++ -c -fno-keep-inline-dllexport -g -std=gnu++11 -Wall -Wextra -Wextra -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I..\..\..\QtProgramming\QtCoreTempTest\QtCoreTempTest -I. -IC:\CoreTempLib -IE:\Qt\5.14.2\mingw73_32\include -IE:\Qt\5.14.2\mingw73_32\include\QtWidgets -IE:\Qt\5.14.2\mingw73_32\include\QtGui -IE:\Qt\5.14.2\mingw73_32\include\QtANGLE -IE:\Qt\5.14.2\mingw73_32\include\QtCore -Idebug -I. -IE:\Qt\5.14.2\mingw73_32\mkspecs\win32-g++  -o debug\main.o ..\..\..\QtProgramming\QtCoreTempTest\QtCoreTempTest\main.cpp
        g++ -c -fno-keep-inline-dllexport -g -std=gnu++11 -Wall -Wextra -Wextra -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I..\..\..\QtProgramming\QtCoreTempTest\QtCoreTempTest -I. -IC:\CoreTempLib -IE:\Qt\5.14.2\mingw73_32\include -IE:\Qt\5.14.2\mingw73_32\include\QtWidgets -IE:\Qt\5.14.2\mingw73_32\include\QtGui -IE:\Qt\5.14.2\mingw73_32\include\QtANGLE -IE:\Qt\5.14.2\mingw73_32\include\QtCore -Idebug -I. -IE:\Qt\5.14.2\mingw73_32\mkspecs\win32-g++  -o debug\mainwindow.o ..\..\..\QtProgramming\QtCoreTempTest\QtCoreTempTest\mainwindow.cpp
        E:\Qt\5.14.2\mingw73_32\bin\moc.exe -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN --include "C:/Users/ariie/Desktop/Qt Programming/QtCoreTempTest/build-QtCoreTempTest-Desktop_Qt_5_14_2_MinGW_32_bit-Debug/debug/moc_predefs.h" -IE:/Qt/5.14.2/mingw73_32/mkspecs/win32-g++ -IC:/Users/ariie/Desktop/QtProgramming/QtCoreTempTest/QtCoreTempTest -IC:/CoreTempLib -IE:/Qt/5.14.2/mingw73_32/include -IE:/Qt/5.14.2/mingw73_32/include/QtWidgets -IE:/Qt/5.14.2/mingw73_32/include/QtGui -IE:/Qt/5.14.2/mingw73_32/include/QtANGLE -IE:/Qt/5.14.2/mingw73_32/include/QtCore -I. -IE:/Qt/Tools/mingw730_32/lib/gcc/i686-w64-mingw32/7.3.0/include/c++ -IE:/Qt/Tools/mingw730_32/lib/gcc/i686-w64-mingw32/7.3.0/include/c++/i686-w64-mingw32 -IE:/Qt/Tools/mingw730_32/lib/gcc/i686-w64-mingw32/7.3.0/include/c++/backward -IE:/Qt/Tools/mingw730_32/lib/gcc/i686-w64-mingw32/7.3.0/include -IE:/Qt/Tools/mingw730_32/lib/gcc/i686-w64-mingw32/7.3.0/include-fixed -IE:/Qt/Tools/mingw730_32/i686-w64-mingw32/include ..\..\..\QtProgramming\QtCoreTempTest\QtCoreTempTest\mainwindow.h -o debug\moc_mainwindow.cpp
        g++ -c -fno-keep-inline-dllexport -g -std=gnu++11 -Wall -Wextra -Wextra -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I..\..\..\QtProgramming\QtCoreTempTest\QtCoreTempTest -I. -IC:\CoreTempLib -IE:\Qt\5.14.2\mingw73_32\include -IE:\Qt\5.14.2\mingw73_32\include\QtWidgets -IE:\Qt\5.14.2\mingw73_32\include\QtGui -IE:\Qt\5.14.2\mingw73_32\include\QtANGLE -IE:\Qt\5.14.2\mingw73_32\include\QtCore -Idebug -I. -IE:\Qt\5.14.2\mingw73_32\mkspecs\win32-g++  -o debug\moc_mainwindow.o debug\moc_mainwindow.cpp
        ..\..\..\QtProgramming\QtCoreTempTest\QtCoreTempTest\mainwindow.cpp: In constructor 'MainWindow::MainWindow(QWidget*)':
        ..\..\..\QtProgramming\QtCoreTempTest\QtCoreTempTest\mainwindow.cpp:12:23: error: cannot bind non-const lvalue reference of type 'CORE_TEMP_SHARED_DATA*& {aka core_temp_shared_data*&}' to an rvalue of type 'CORE_TEMP_SHARED_DATA* {aka core_temp_shared_data*}'
             fnGetCoreTempInfo(&ct);
                               ^~~
        In file included from ..\..\..\QtProgramming\QtCoreTempTest\QtCoreTempTest\mainwindow.h:7:0,
                         from ..\..\..\QtProgramming\QtCoreTempTest\QtCoreTempTest\mainwindow.cpp:1:
        C:\CoreTempLib/GetCoreTempinfo.h:27:26: note:   initializing argument 1 of 'bool fnGetCoreTempInfo(CORE_TEMP_SHARED_DATA*&)'
         bool GETCORETEMPINFO_API fnGetCoreTempInfo(CORE_TEMP_SHARED_DATA *&pData);
                                  ^~~~~~~~~~~~~~~~~
        mingw32-make[1]: *** [Makefile.Debug:472: debug/mainwindow.o] Error 1
        mingw32-make[1]: *** Waiting for unfinished jobs....
        mingw32-make[1]: Leaving directory 'C:/Users/ariie/Desktop/Qt Programming/QtCoreTempTest/build-QtCoreTempTest-Desktop_Qt_5_14_2_MinGW_32_bit-Debug'
        mingw32-make: *** [Makefile:45: debug] Error 2
        17:48:42: The process "E:\Qt\Tools\mingw730_32\bin\mingw32-make.exe" exited with code 2.
        Error while building/deploying project QtCoreTempTest (kit: Desktop Qt 5.14.2 MinGW 32-bit)
        When executing step "Make"
        17:48:42: Elapsed time: 00:06.
        

        Any ideas? This is the first time I've used external DLLs with Qt C++; I usually code in C on Linux, where all you have to do is add the "-llibrary" parameter on the end of the complication command!

        Thanks,
        Ryan

        1 Reply Last reply
        0
        • VRoninV Offline
          VRoninV Offline
          VRonin
          wrote on last edited by
          #11

          can you post the contents of GetCoreTempinfo.h?

          "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
          ~Napoleon Bonaparte

          On a crusade to banish setIndexWidget() from the holy land of Qt

          1 Reply Last reply
          1
          • R Offline
            R Offline
            Ryan R
            wrote on last edited by
            #12

            Here's the imported "GetCoreTempinfo.h".

            Qt does display errors for this header file, now that I've opened it; ranging from unknown type names for UINT and DWORD variables, as well as a few semantic issues. Could the library be incompatible with Qt?

            #pragma once
            
            #ifdef GETCORETEMPINFO_EXPORTS
            #define GETCORETEMPINFO_API __declspec(dllexport)
            #else
            #define GETCORETEMPINFO_API __declspec(dllimport)
            #endif
            
            #define UNKNOWN_EXCEPTION 0x20000000
            
            typedef struct core_temp_shared_data
            {
            	unsigned int	uiLoad[256];
            	unsigned int	uiTjMax[128];
            	unsigned int	uiCoreCnt;
            	unsigned int	uiCPUCnt;
            	float			fTemp[256];
            	float			fVID;
            	float			fCPUSpeed;
            	float			fFSBSpeed;
            	float			fMultipier;	
            	char			sCPUName[100];
            	unsigned char	ucFahrenheit;
            	unsigned char	ucDeltaToTjMax;
            }CORE_TEMP_SHARED_DATA,*PCORE_TEMP_SHARED_DATA,**PPCORE_TEMP_SHARED_DATA;
            
            bool GETCORETEMPINFO_API fnGetCoreTempInfo(CORE_TEMP_SHARED_DATA *&pData);
            bool WINAPI fnGetCoreTempInfoAlt(CORE_TEMP_SHARED_DATA *pData);
            
            class GETCORETEMPINFO_API CoreTempProxy
            {
            public:
            	CoreTempProxy(void);
            	virtual ~CoreTempProxy(void);
            	
            	UINT GetCoreLoad(int Index) const;
                UINT GetTjMax(int Index) const;
                UINT GetCoreCount() const;
                UINT GetCPUCount() const;
                float GetTemp(int Index) const;
                float GetVID() const;
                float GetCPUSpeed() const;
                float GetFSBSpeed() const;
                float GetMultiplier() const;
                LPCSTR GetCPUName() const;
                bool IsFahrenheit() const;
                bool IsDistanceToTjMax() const;
                const CORE_TEMP_SHARED_DATA &GetDataStruct() const;
            
            	bool GetData();
            	DWORD GetDllError() const { return GetLastError(); }
            	LPCWSTR GetErrorMessage();
            private:
            
            	CORE_TEMP_SHARED_DATA m_pCoreTempData;
            	WCHAR m_ErrorMessage[100];
            };
            
            

            Thanks for the quick replies!
            Ryan

            JonBJ 1 Reply Last reply
            0
            • R Ryan R

              Here's the imported "GetCoreTempinfo.h".

              Qt does display errors for this header file, now that I've opened it; ranging from unknown type names for UINT and DWORD variables, as well as a few semantic issues. Could the library be incompatible with Qt?

              #pragma once
              
              #ifdef GETCORETEMPINFO_EXPORTS
              #define GETCORETEMPINFO_API __declspec(dllexport)
              #else
              #define GETCORETEMPINFO_API __declspec(dllimport)
              #endif
              
              #define UNKNOWN_EXCEPTION 0x20000000
              
              typedef struct core_temp_shared_data
              {
              	unsigned int	uiLoad[256];
              	unsigned int	uiTjMax[128];
              	unsigned int	uiCoreCnt;
              	unsigned int	uiCPUCnt;
              	float			fTemp[256];
              	float			fVID;
              	float			fCPUSpeed;
              	float			fFSBSpeed;
              	float			fMultipier;	
              	char			sCPUName[100];
              	unsigned char	ucFahrenheit;
              	unsigned char	ucDeltaToTjMax;
              }CORE_TEMP_SHARED_DATA,*PCORE_TEMP_SHARED_DATA,**PPCORE_TEMP_SHARED_DATA;
              
              bool GETCORETEMPINFO_API fnGetCoreTempInfo(CORE_TEMP_SHARED_DATA *&pData);
              bool WINAPI fnGetCoreTempInfoAlt(CORE_TEMP_SHARED_DATA *pData);
              
              class GETCORETEMPINFO_API CoreTempProxy
              {
              public:
              	CoreTempProxy(void);
              	virtual ~CoreTempProxy(void);
              	
              	UINT GetCoreLoad(int Index) const;
                  UINT GetTjMax(int Index) const;
                  UINT GetCoreCount() const;
                  UINT GetCPUCount() const;
                  float GetTemp(int Index) const;
                  float GetVID() const;
                  float GetCPUSpeed() const;
                  float GetFSBSpeed() const;
                  float GetMultiplier() const;
                  LPCSTR GetCPUName() const;
                  bool IsFahrenheit() const;
                  bool IsDistanceToTjMax() const;
                  const CORE_TEMP_SHARED_DATA &GetDataStruct() const;
              
              	bool GetData();
              	DWORD GetDllError() const { return GetLastError(); }
              	LPCWSTR GetErrorMessage();
              private:
              
              	CORE_TEMP_SHARED_DATA m_pCoreTempData;
              	WCHAR m_ErrorMessage[100];
              };
              
              

              Thanks for the quick replies!
              Ryan

              JonBJ Offline
              JonBJ Offline
              JonB
              wrote on last edited by
              #13

              @Ryan-R said in Core Temp Shared Memory in Qt C++ - Windows:

              Qt does display errors for this header file, now that I've opened it; ranging from unknown type names for UINT and DWORD variables,

              This is a Windows-specific header file. You will need to include something like #include <windows.h> before this header file for it to be acceptable, since it does not do so itself.

              R 1 Reply Last reply
              2
              • JonBJ JonB

                @Ryan-R said in Core Temp Shared Memory in Qt C++ - Windows:

                Qt does display errors for this header file, now that I've opened it; ranging from unknown type names for UINT and DWORD variables,

                This is a Windows-specific header file. You will need to include something like #include <windows.h> before this header file for it to be acceptable, since it does not do so itself.

                R Offline
                R Offline
                Ryan R
                wrote on last edited by
                #14

                @JonB I've got "#include <windows.h>" inside "mainwindow.h", so shouldn't it be recognised?

                #include <QMainWindow>
                #include <windows.h> // see note 1
                #include <GetCoreTempinfo.h>
                #include <QDebug>
                #include <QString>
                

                I do get a warning about "#include <GetCoreTempinfo.h>"; "non-portable path to file ' <GetCoreTempinfo.h>'; specified path differs in case from file name on disk.

                Thanks,
                Ryan

                JonBJ 1 Reply Last reply
                0
                • R Ryan R

                  @JonB I've got "#include <windows.h>" inside "mainwindow.h", so shouldn't it be recognised?

                  #include <QMainWindow>
                  #include <windows.h> // see note 1
                  #include <GetCoreTempinfo.h>
                  #include <QDebug>
                  #include <QString>
                  

                  I do get a warning about "#include <GetCoreTempinfo.h>"; "non-portable path to file ' <GetCoreTempinfo.h>'; specified path differs in case from file name on disk.

                  Thanks,
                  Ryan

                  JonBJ Offline
                  JonBJ Offline
                  JonB
                  wrote on last edited by JonB
                  #15

                  @Ryan-R
                  So that would look like it makes it OK to compile when included via mainwindow.h, which is fine. But when you ask Creator to read in GetCoreTempinfo.h to view on its own, it might give warnings without windows.h. That's OK, so long as it compiles.

                  "#include <GetCoreTempinfo.h>"; "non-portable path to file ' <GetCoreTempinfo.h>'; specified path differs in case from file name on disk.

                  You include GetCoreTempinfo.h. I imagine you have saved/copied this file onto disk with e.g. all lower case letters. You will be OK under Windows; you might like to rename the file to match the way it is spelt here anyway, but not vital.

                  1 Reply Last reply
                  1
                  • VRoninV Offline
                    VRoninV Offline
                    VRonin
                    wrote on last edited by
                    #16

                    I see, the header file doesn't match the documentation on the website, typical :)

                    So it should be something like this:

                    #include <windows.h>
                    #include <GetCoreTempinfo.h>
                    
                    // other stuff in your program
                    
                    CORE_TEMP_SHARED_DATA ct;
                    fnGetCoreTempInfo(&ct);
                    qDebug() << "\n\n\nTest: " << QString::number(ct.fTemp[1]);
                    

                    "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
                    ~Napoleon Bonaparte

                    On a crusade to banish setIndexWidget() from the holy land of Qt

                    1 Reply Last reply
                    1
                    • R Offline
                      R Offline
                      Ryan R
                      wrote on last edited by
                      #17

                      @VRonin The Core Temp side seems to be poorly documentated in general!

                      The only issue with using "fnGetCoreTempInfo(&ct);" is the following errror.

                      ..\..\..\QtProgramming\QtCoreTempTest\QtCoreTempTest\mainwindow.cpp:12:23: error: cannot bind non-const lvalue reference of type 'CORE_TEMP_SHARED_DATA*& {aka core_temp_shared_data*&}' to an rvalue of type 'CORE_TEMP_SHARED_DATA* {aka core_temp_shared_data*}'
                      

                      It seems that one reference is a *&, and the other is just *; with the following compiler output.

                      12:32:46: Running steps for project QtCoreTempTest...
                      12:32:46: Configuration unchanged, skipping qmake step.
                      12:32:46: Starting: "E:\Qt\Tools\mingw730_32\bin\mingw32-make.exe" -j8
                      E:/Qt/Tools/mingw730_32/bin/mingw32-make -f Makefile.Debug
                      mingw32-make[1]: Entering directory 'C:/Users/ariie/Desktop/Qt Programming/QtCoreTempTest/build-QtCoreTempTest-Desktop_Qt_5_14_2_MinGW_32_bit-Debug'
                      g++ -c -fno-keep-inline-dllexport -g -std=gnu++11 -Wall -Wextra -Wextra -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I..\..\..\QtProgramming\QtCoreTempTest\QtCoreTempTest -I. -IC:\CoreTempLib -IE:\Qt\5.14.2\mingw73_32\include -IE:\Qt\5.14.2\mingw73_32\include\QtWidgets -IE:\Qt\5.14.2\mingw73_32\include\QtGui -IE:\Qt\5.14.2\mingw73_32\include\QtANGLE -IE:\Qt\5.14.2\mingw73_32\include\QtCore -Idebug -I. -IE:\Qt\5.14.2\mingw73_32\mkspecs\win32-g++  -o debug\main.o ..\..\..\QtProgramming\QtCoreTempTest\QtCoreTempTest\main.cpp
                      g++ -c -fno-keep-inline-dllexport -g -std=gnu++11 -Wall -Wextra -Wextra -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I..\..\..\QtProgramming\QtCoreTempTest\QtCoreTempTest -I. -IC:\CoreTempLib -IE:\Qt\5.14.2\mingw73_32\include -IE:\Qt\5.14.2\mingw73_32\include\QtWidgets -IE:\Qt\5.14.2\mingw73_32\include\QtGui -IE:\Qt\5.14.2\mingw73_32\include\QtANGLE -IE:\Qt\5.14.2\mingw73_32\include\QtCore -Idebug -I. -IE:\Qt\5.14.2\mingw73_32\mkspecs\win32-g++  -o debug\mainwindow.o ..\..\..\QtProgramming\QtCoreTempTest\QtCoreTempTest\mainwindow.cpp
                      E:\Qt\5.14.2\mingw73_32\bin\moc.exe -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN --include "C:/Users/ariie/Desktop/Qt Programming/QtCoreTempTest/build-QtCoreTempTest-Desktop_Qt_5_14_2_MinGW_32_bit-Debug/debug/moc_predefs.h" -IE:/Qt/5.14.2/mingw73_32/mkspecs/win32-g++ -IC:/Users/ariie/Desktop/QtProgramming/QtCoreTempTest/QtCoreTempTest -IC:/CoreTempLib -IE:/Qt/5.14.2/mingw73_32/include -IE:/Qt/5.14.2/mingw73_32/include/QtWidgets -IE:/Qt/5.14.2/mingw73_32/include/QtGui -IE:/Qt/5.14.2/mingw73_32/include/QtANGLE -IE:/Qt/5.14.2/mingw73_32/include/QtCore -I. -IE:/Qt/Tools/mingw730_32/lib/gcc/i686-w64-mingw32/7.3.0/include/c++ -IE:/Qt/Tools/mingw730_32/lib/gcc/i686-w64-mingw32/7.3.0/include/c++/i686-w64-mingw32 -IE:/Qt/Tools/mingw730_32/lib/gcc/i686-w64-mingw32/7.3.0/include/c++/backward -IE:/Qt/Tools/mingw730_32/lib/gcc/i686-w64-mingw32/7.3.0/include -IE:/Qt/Tools/mingw730_32/lib/gcc/i686-w64-mingw32/7.3.0/include-fixed -IE:/Qt/Tools/mingw730_32/i686-w64-mingw32/include ..\..\..\QtProgramming\QtCoreTempTest\QtCoreTempTest\mainwindow.h -o debug\moc_mainwindow.cpp
                      g++ -c -fno-keep-inline-dllexport -g -std=gnu++11 -Wall -Wextra -Wextra -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I..\..\..\QtProgramming\QtCoreTempTest\QtCoreTempTest -I. -IC:\CoreTempLib -IE:\Qt\5.14.2\mingw73_32\include -IE:\Qt\5.14.2\mingw73_32\include\QtWidgets -IE:\Qt\5.14.2\mingw73_32\include\QtGui -IE:\Qt\5.14.2\mingw73_32\include\QtANGLE -IE:\Qt\5.14.2\mingw73_32\include\QtCore -Idebug -I. -IE:\Qt\5.14.2\mingw73_32\mkspecs\win32-g++  -o debug\moc_mainwindow.o debug\moc_mainwindow.cpp
                      ..\..\..\QtProgramming\QtCoreTempTest\QtCoreTempTest\mainwindow.cpp: In constructor 'MainWindow::MainWindow(QWidget*)':
                      ..\..\..\QtProgramming\QtCoreTempTest\QtCoreTempTest\mainwindow.cpp:12:23: error: cannot bind non-const lvalue reference of type 'CORE_TEMP_SHARED_DATA*& {aka core_temp_shared_data*&}' to an rvalue of type 'CORE_TEMP_SHARED_DATA* {aka core_temp_shared_data*}'
                           fnGetCoreTempInfo(&ct);
                                             ^~~
                      In file included from ..\..\..\QtProgramming\QtCoreTempTest\QtCoreTempTest\mainwindow.h:7:0,
                                       from ..\..\..\QtProgramming\QtCoreTempTest\QtCoreTempTest\mainwindow.cpp:1:
                      C:\CoreTempLib/GetCoreTempInfo.h:27:26: note:   initializing argument 1 of 'bool fnGetCoreTempInfo(CORE_TEMP_SHARED_DATA*&)'
                       bool GETCORETEMPINFO_API fnGetCoreTempInfo(CORE_TEMP_SHARED_DATA *&pData);
                                                ^~~~~~~~~~~~~~~~~
                      mingw32-make[1]: *** [Makefile.Debug:472: debug/mainwindow.o] Error 1
                      mingw32-make[1]: *** Waiting for unfinished jobs....
                      mingw32-make[1]: Leaving directory 'C:/Users/ariie/Desktop/Qt Programming/QtCoreTempTest/build-QtCoreTempTest-Desktop_Qt_5_14_2_MinGW_32_bit-Debug'
                      mingw32-make: *** [Makefile:45: debug] Error 2
                      12:32:52: The process "E:\Qt\Tools\mingw730_32\bin\mingw32-make.exe" exited with code 2.
                      Error while building/deploying project QtCoreTempTest (kit: Desktop Qt 5.14.2 MinGW 32-bit)
                      When executing step "Make"
                      12:32:52: Elapsed time: 00:06.
                      

                      Thanks,
                      Ryan

                      1 Reply Last reply
                      0
                      • VRoninV Offline
                        VRoninV Offline
                        VRonin
                        wrote on last edited by
                        #18

                        And this is why I don't like programming in C.

                        CORE_TEMP_SHARED_DATA ct;
                        CORE_TEMP_SHARED_DATA* pct=&ct;
                        fnGetCoreTempInfo(pct);
                        qDebug() << "\n\n\nTest: " << QString::number(ct.fTemp[1]);
                        

                        "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
                        ~Napoleon Bonaparte

                        On a crusade to banish setIndexWidget() from the holy land of Qt

                        1 Reply Last reply
                        1
                        • R Offline
                          R Offline
                          Ryan R
                          wrote on last edited by
                          #19

                          @VRonin Yea it's a bit tricky for me coming from C to C++, especially with Windows!

                          Everything is getting recognised properly, but there's just one build issue on "fnGetCoreTempInfo(pct);". The error is as follows;

                          C:\Users\ariie\Desktop\QtProgramming\QtCoreTempTest\QtCoreTempTest\mainwindow.cpp:13: error: undefined reference to `_imp___Z17fnGetCoreTempInfoRP21core_temp_shared_data'
                          

                          Thanks again for the responses,
                          Ryan

                          1 Reply Last reply
                          0
                          • VRoninV Offline
                            VRoninV Offline
                            VRonin
                            wrote on last edited by
                            #20

                            what are the contents of the CoreTempLib/x86/ folder (I can't trust the docs apparently)?

                            "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
                            ~Napoleon Bonaparte

                            On a crusade to banish setIndexWidget() from the holy land of Qt

                            1 Reply Last reply
                            1
                            • R Offline
                              R Offline
                              Ryan R
                              wrote on last edited by Ryan R
                              #21

                              @VRonin

                              b505045b-f13b-464a-8f52-3f675be3f2b8-image.png

                              f3be67de-f418-474e-9378-1ac87c7701b9-image.png

                              Thanks,
                              Ryan

                              1 Reply Last reply
                              0
                              • VRoninV Offline
                                VRoninV Offline
                                VRonin
                                wrote on last edited by
                                #22

                                I finally gave up and actually downloaded the library otherwise we'll take forever.
                                They are incompatible with MinGW, good old @SGaist is always right.
                                You need to use Visual Studio or visual studio build tools to link against it

                                "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
                                ~Napoleon Bonaparte

                                On a crusade to banish setIndexWidget() from the holy land of Qt

                                JonBJ 1 Reply Last reply
                                4
                                • R Offline
                                  R Offline
                                  Ryan R
                                  wrote on last edited by Ryan R
                                  #23

                                  @VRonin

                                  That was the clue I needed! I changed to kit to MSVC2017 and it started working perfectly, with your modifications!

                                  I'll get it all on a GUI, post the project here and mark the topic as solved!

                                  I can't thank you enough!

                                  Ryan

                                  1 Reply Last reply
                                  0
                                  • VRoninV VRonin

                                    I finally gave up and actually downloaded the library otherwise we'll take forever.
                                    They are incompatible with MinGW, good old @SGaist is always right.
                                    You need to use Visual Studio or visual studio build tools to link against it

                                    JonBJ Offline
                                    JonBJ Offline
                                    JonB
                                    wrote on last edited by
                                    #24

                                    @VRonin said in Core Temp Shared Memory in Qt C++ - Windows:

                                    good old @SGaist is always right.

                                    I know, it's really irritating isn't it? ;-)

                                    1 Reply Last reply
                                    0
                                    • R Offline
                                      R Offline
                                      Ryan R
                                      wrote on last edited by Ryan R
                                      #25

                                      At least we got there in the end!

                                      For anyone else wanting to make a PC monitoring system, I am releasing the full test project for Core Temp Shared Memory below.

                                      • Make sure Core Temp is installed & running. I use the following settings: enable plug-ins, start core temp with Windows, start core temp minimized.
                                      • You must tick "Enable global shared memory (SNMP)" inside Core Temp advanced settings!
                                      • Make sure you're using MSVC compiler; I used 2017 32-bit on Qt 5.14.2, Windows 10 64-bit .
                                      • Download the library and put it somewhere useful (No spaces, in a directory with a short file path).
                                      • Import the library by right clicking the project; external library, untick Linux & Mac.
                                      • Point the library file path to the folder corrosponding to your architecture (x86 or x64), depending on your compiler. Example "C:\CoreTempLib\x86".
                                      • Point the include path to the root directory of the library (should have Borland, x64, x86 & GetCoreTempInfo.h inside). Example "C:\CoreTempLib".
                                      • Now you can insert the header files "windows.h" and "GetCoreTempInfo.h" and use the library.
                                                  CORE_TEMP_SHARED_DATA* pct=&ct;
                                                  fnGetCoreTempInfo(pct);
                                      
                                      qDebug() << "Core 0 Temperature: "<< ct.fTemp[0] << " C.";
                                      

                                      f78f9358-9b96-4b7f-acee-ba8452ab49ab-image.png

                                      I made this quick project with C++/XML. It uses QThread and grabs the CPU data every second and pushes it to the GUI, without blocking it. Some of the code is messy, but it's just a quick example so other people don't have to go through this! If I've done anything dramatically wrong (like use Mutex incorrectly), I'm not sure if people can still post on this topic after I mark it as solved, so just PM me and I should be able to make the edits. Feel free to use any of the code below however you want.

                                      QtCoreTempTest.pro

                                      QT       += core gui
                                      
                                      greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
                                      
                                      CONFIG += c++11
                                      
                                      DEFINES += QT_DEPRECATED_WARNINGS
                                      
                                      SOURCES += \
                                          cputhread.cpp \
                                          main.cpp \
                                          mainwindow.cpp
                                      
                                      HEADERS += \
                                          cputhread.h \
                                          mainwindow.h
                                      
                                      FORMS += \
                                          mainwindow.ui
                                      
                                      # Default rules for deployment.
                                      qnx: target.path = /tmp/$${TARGET}/bin
                                      else: unix:!android: target.path = /opt/$${TARGET}/bin
                                      !isEmpty(target.path): INSTALLS += target
                                      
                                      
                                      win32: LIBS += -L$$PWD/../../../../../../CoreTempLib/x86/ -lGetCoreTempInfo
                                      
                                      INCLUDEPATH += $$PWD/../../../../../../CoreTempLib
                                      DEPENDPATH += $$PWD/../../../../../../CoreTempLib/x86
                                      

                                      mainwindow.h

                                      #ifndef MAINWINDOW_H
                                      #define MAINWINDOW_H
                                      
                                      #include <QMainWindow>
                                      #include <QDebug>
                                      #include <QString>
                                      #include <QVariant>
                                      #include <QByteArray>
                                      #include <QMutex>
                                      #include <QThread>
                                      
                                      #include <stdio.h>
                                      
                                      #include "cputhread.h"
                                      
                                      QT_BEGIN_NAMESPACE
                                      namespace Ui { class MainWindow; }
                                      QT_END_NAMESPACE
                                      
                                      class MainWindow : public QMainWindow
                                      {
                                          Q_OBJECT
                                      
                                      public:
                                          MainWindow(QWidget *parent = nullptr);
                                          ~MainWindow();
                                          CPUThread *mCPUThread;
                                      
                                      public slots:
                                          void onValueChanged(int, int, int, int, float, float, float, float, int, int, float, float, float, float, char, char, QString);
                                      
                                      private:
                                          Ui::MainWindow *ui;
                                      };
                                      #endif // MAINWINDOW_H
                                      

                                      mainwindow.cpp

                                      #include "mainwindow.h"
                                      #include "ui_mainwindow.h"
                                      
                                      
                                      MainWindow::MainWindow(QWidget *parent)
                                          : QMainWindow(parent)
                                          , ui(new Ui::MainWindow)
                                      {
                                          ui->setupUi(this);
                                      
                                          ui->labelInfo->setText("You must install the Core Temp SDK and import the libraries for this to work! <br /> <a href=\"http://alcpu.com/CoreTemp/developers.html\">SDK</a> <br /><br /> <a href=\"https://forum.qt.io/topic/115469/core-temp-shared-memory-in-qt-c-windows/24\">Forum</a>   ");
                                          ui->labelInfo->setTextFormat(Qt::RichText);
                                          ui->labelInfo->setTextInteractionFlags(Qt::TextBrowserInteraction);
                                          ui->labelInfo->setOpenExternalLinks(true);
                                      
                                          mCPUThread = new CPUThread(this);
                                      
                                          connect(mCPUThread, SIGNAL(valueChanged(int, int, int, int, float, float, float, float, int, int, float, float, float, float, char, char, QString)), this, SLOT(onValueChanged(int, int, int, int, float, float, float, float, int, int, float, float, float, float, char, char, QString)));
                                      
                                          mCPUThread->start();
                                      }
                                      
                                      void MainWindow::onValueChanged(int cpuLoad0, int cpuLoad1, int cpuLoad2, int cpuLoad3, float cpuTemp0, float cpuTemp1, float cpuTemp2, float cpuTemp3, int cpuTjMax, int cpuCoreCount, float cpuID, float cpuFsbSpeed, float cpuMultiplier, float cpuSpeed, char cpuFah, char cpuDeltaToMax, QString cpuName)
                                      {
                                          qDebug() << "From Thread: " << cpuLoad0 << "," << cpuLoad1 << "," << cpuLoad2 << "," << cpuLoad3 << "," << cpuTemp0 << "," << cpuTemp1 << "," << cpuTemp2 << "," << cpuTemp3 << "," << cpuTjMax << "," << cpuCoreCount << "," <<  cpuID << "," << cpuFsbSpeed << "," << cpuMultiplier << "," << cpuSpeed << "," << cpuFah << "," << cpuDeltaToMax << "," << cpuName << ".";
                                          ui->cpuLoad0->setValue(cpuLoad0);
                                          ui->cpuLoad1->setValue(cpuLoad1);
                                          ui->cpuLoad2->setValue(cpuLoad2);
                                          ui->cpuLoad3->setValue(cpuLoad3);
                                      
                                          ui->cpuTemp0->setValue(cpuTemp0);
                                          ui->cpuTemp1->setValue(cpuTemp1);
                                          ui->cpuTemp2->setValue(cpuTemp2);
                                          ui->cpuTemp3->setValue(cpuTemp3);
                                      
                                          ui->labelTjMax->setText(QString::number(cpuTjMax));
                                          ui->labelCoreCount->setText(QString::number(cpuCoreCount));
                                          ui->labelId->setText(QString::number(cpuID));
                                          ui->labelFsbSpeed->setText(QString::number(cpuFsbSpeed));
                                          ui->labelMultiplier->setText(QString::number(cpuMultiplier));
                                          ui->labelSpeed->setText(QString::number(cpuSpeed));
                                          ui->labelName->setText(cpuName);
                                      }
                                      
                                      MainWindow::~MainWindow()
                                      {
                                          delete ui;
                                      }
                                      

                                      cputhread.h

                                      #ifndef CPUTHREAD_H
                                      #define CPUTHREAD_H
                                      
                                      
                                      #include <QObject>
                                      #include <QThread>
                                      #include <windows.h>
                                      #include <GetCoreTempInfo.h>
                                      
                                      // Counts from 1 to 100.
                                      
                                      class CPUThread : public QThread
                                      {
                                      Q_OBJECT
                                      public:
                                      CPUThread();
                                      explicit CPUThread(QObject *parent = 0, bool b = false);
                                      void run();
                                      
                                      // if Stop = true, the thread will break
                                      // out of the loop, and will be disposed
                                      bool Stop;
                                      
                                      signals:
                                      // To communicate with Gui Thread
                                      // we need to emit a signal
                                      void valueChanged(int, int, int, int, float, float, float, float, int, int, float, float, float, float, char, char, QString);
                                      
                                      public slots:
                                      
                                      };
                                      #endif // CPUTHREAD_H
                                      

                                      cputhread.cpp

                                      #include "cputhread.h"
                                      #include <QDebug>
                                      #include <QMutex>
                                      
                                      #include<stdio.h>
                                      
                                          CPUThread::CPUThread(QObject *parent, bool b) :
                                              QThread(parent), Stop(b)
                                          {
                                          }
                                      
                                         // run() will be called when a thread starts
                                          void CPUThread::run()
                                          {
                                              for(int i = 0; i <= 100; i++)
                                              {
                                                  QMutex mutex;
                                                  // prevent other threads from changing the "Stop" value
                                                  mutex.lock();
                                                  if(this->Stop) break;
                                                  mutex.unlock();
                                      
                                                  CORE_TEMP_SHARED_DATA ct;
                                                  CORE_TEMP_SHARED_DATA* pct=&ct;
                                                  fnGetCoreTempInfo(pct);
                                      
                                      
                                      
                                                  char cName[100] = "-1";
                                                  strcpy(cName, ct.sCPUName);
                                                  QString cpuName(cName);
                                      
                                                  emit valueChanged(ct.uiLoad[0], ct.uiLoad[1], ct.uiLoad[2], ct.uiLoad[3], ct.fTemp[0], ct.fTemp[1], ct.fTemp[2], ct.fTemp[3], ct.uiTjMax[0], ct.uiCoreCnt, ct.fVID, ct.fFSBSpeed, ct.fMultipier, ct.fCPUSpeed, ct.ucFahrenheit, ct.ucDeltaToTjMax, cpuName);
                                      
                                                  this->sleep(1);
                                      
                                                  if(i > 99)
                                                  {
                                                      i = 0;
                                                  }
                                              }
                                              run();
                                            }
                                      

                                      main.cpp

                                      #include "mainwindow.h"
                                      
                                      #include <QApplication>
                                      
                                      int main(int argc, char *argv[])
                                      {
                                          QApplication a(argc, argv);
                                          MainWindow w;
                                          w.show();
                                          return a.exec();
                                      }
                                      
                                      

                                      mainwindow.ui

                                      <?xml version="1.0" encoding="UTF-8"?>
                                      <ui version="4.0">
                                       <class>MainWindow</class>
                                       <widget class="QMainWindow" name="MainWindow">
                                        <property name="geometry">
                                         <rect>
                                          <x>0</x>
                                          <y>0</y>
                                          <width>712</width>
                                          <height>246</height>
                                         </rect>
                                        </property>
                                        <property name="windowTitle">
                                         <string>Core Temp Shared Memory</string>
                                        </property>
                                        <widget class="QWidget" name="centralwidget">
                                         <widget class="QProgressBar" name="cpuLoad0">
                                          <property name="geometry">
                                           <rect>
                                            <x>40</x>
                                            <y>40</y>
                                            <width>118</width>
                                            <height>23</height>
                                           </rect>
                                          </property>
                                          <property name="value">
                                           <number>0</number>
                                          </property>
                                         </widget>
                                         <widget class="QProgressBar" name="cpuLoad1">
                                          <property name="geometry">
                                           <rect>
                                            <x>40</x>
                                            <y>80</y>
                                            <width>118</width>
                                            <height>23</height>
                                           </rect>
                                          </property>
                                          <property name="value">
                                           <number>0</number>
                                          </property>
                                         </widget>
                                         <widget class="QProgressBar" name="cpuLoad2">
                                          <property name="geometry">
                                           <rect>
                                            <x>40</x>
                                            <y>120</y>
                                            <width>118</width>
                                            <height>23</height>
                                           </rect>
                                          </property>
                                          <property name="value">
                                           <number>0</number>
                                          </property>
                                         </widget>
                                         <widget class="QProgressBar" name="cpuLoad3">
                                          <property name="geometry">
                                           <rect>
                                            <x>40</x>
                                            <y>160</y>
                                            <width>118</width>
                                            <height>23</height>
                                           </rect>
                                          </property>
                                          <property name="value">
                                           <number>0</number>
                                          </property>
                                         </widget>
                                         <widget class="QLabel" name="label">
                                          <property name="geometry">
                                           <rect>
                                            <x>40</x>
                                            <y>10</y>
                                            <width>151</width>
                                            <height>16</height>
                                           </rect>
                                          </property>
                                          <property name="text">
                                           <string>Physical Core Load</string>
                                          </property>
                                         </widget>
                                         <widget class="QProgressBar" name="cpuTemp2">
                                          <property name="geometry">
                                           <rect>
                                            <x>200</x>
                                            <y>120</y>
                                            <width>118</width>
                                            <height>23</height>
                                           </rect>
                                          </property>
                                          <property name="value">
                                           <number>0</number>
                                          </property>
                                          <property name="format">
                                           <string>%p C</string>
                                          </property>
                                         </widget>
                                         <widget class="QLabel" name="label_2">
                                          <property name="geometry">
                                           <rect>
                                            <x>200</x>
                                            <y>10</y>
                                            <width>151</width>
                                            <height>16</height>
                                           </rect>
                                          </property>
                                          <property name="text">
                                           <string>Physical Core Load</string>
                                          </property>
                                         </widget>
                                         <widget class="QProgressBar" name="cpuTemp0">
                                          <property name="geometry">
                                           <rect>
                                            <x>200</x>
                                            <y>40</y>
                                            <width>118</width>
                                            <height>23</height>
                                           </rect>
                                          </property>
                                          <property name="styleSheet">
                                           <string notr="true"/>
                                          </property>
                                          <property name="value">
                                           <number>0</number>
                                          </property>
                                          <property name="format">
                                           <string>%p C</string>
                                          </property>
                                         </widget>
                                         <widget class="QProgressBar" name="cpuTemp3">
                                          <property name="geometry">
                                           <rect>
                                            <x>200</x>
                                            <y>160</y>
                                            <width>118</width>
                                            <height>23</height>
                                           </rect>
                                          </property>
                                          <property name="value">
                                           <number>0</number>
                                          </property>
                                          <property name="format">
                                           <string>%p C</string>
                                          </property>
                                         </widget>
                                         <widget class="QProgressBar" name="cpuTemp1">
                                          <property name="geometry">
                                           <rect>
                                            <x>200</x>
                                            <y>80</y>
                                            <width>118</width>
                                            <height>23</height>
                                           </rect>
                                          </property>
                                          <property name="value">
                                           <number>0</number>
                                          </property>
                                          <property name="format">
                                           <string>%p C</string>
                                          </property>
                                         </widget>
                                         <widget class="QLabel" name="label_3">
                                          <property name="geometry">
                                           <rect>
                                            <x>350</x>
                                            <y>10</y>
                                            <width>121</width>
                                            <height>16</height>
                                           </rect>
                                          </property>
                                          <property name="text">
                                           <string>tjMax:</string>
                                          </property>
                                         </widget>
                                         <widget class="QLabel" name="labelTjMax">
                                          <property name="geometry">
                                           <rect>
                                            <x>470</x>
                                            <y>10</y>
                                            <width>41</width>
                                            <height>16</height>
                                           </rect>
                                          </property>
                                          <property name="text">
                                           <string>0</string>
                                          </property>
                                         </widget>
                                         <widget class="QLabel" name="label_4">
                                          <property name="geometry">
                                           <rect>
                                            <x>350</x>
                                            <y>40</y>
                                            <width>121</width>
                                            <height>16</height>
                                           </rect>
                                          </property>
                                          <property name="text">
                                           <string>Core Count:</string>
                                          </property>
                                         </widget>
                                         <widget class="QLabel" name="labelCoreCount">
                                          <property name="geometry">
                                           <rect>
                                            <x>470</x>
                                            <y>40</y>
                                            <width>41</width>
                                            <height>16</height>
                                           </rect>
                                          </property>
                                          <property name="text">
                                           <string>0</string>
                                          </property>
                                         </widget>
                                         <widget class="QLabel" name="labelInfo">
                                          <property name="geometry">
                                           <rect>
                                            <x>570</x>
                                            <y>10</y>
                                            <width>121</width>
                                            <height>201</height>
                                           </rect>
                                          </property>
                                          <property name="text">
                                           <string>Loading...</string>
                                          </property>
                                          <property name="alignment">
                                           <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
                                          </property>
                                          <property name="wordWrap">
                                           <bool>true</bool>
                                          </property>
                                         </widget>
                                         <widget class="QLabel" name="label_6">
                                          <property name="geometry">
                                           <rect>
                                            <x>350</x>
                                            <y>70</y>
                                            <width>121</width>
                                            <height>16</height>
                                           </rect>
                                          </property>
                                          <property name="text">
                                           <string>ID:</string>
                                          </property>
                                         </widget>
                                         <widget class="QLabel" name="label_7">
                                          <property name="geometry">
                                           <rect>
                                            <x>350</x>
                                            <y>100</y>
                                            <width>121</width>
                                            <height>16</height>
                                           </rect>
                                          </property>
                                          <property name="text">
                                           <string>FSB Speed:</string>
                                          </property>
                                         </widget>
                                         <widget class="QLabel" name="label_8">
                                          <property name="geometry">
                                           <rect>
                                            <x>350</x>
                                            <y>130</y>
                                            <width>121</width>
                                            <height>16</height>
                                           </rect>
                                          </property>
                                          <property name="text">
                                           <string>Multiplier: </string>
                                          </property>
                                         </widget>
                                         <widget class="QLabel" name="label_9">
                                          <property name="geometry">
                                           <rect>
                                            <x>350</x>
                                            <y>160</y>
                                            <width>121</width>
                                            <height>16</height>
                                           </rect>
                                          </property>
                                          <property name="text">
                                           <string>CPU Speed:</string>
                                          </property>
                                         </widget>
                                         <widget class="QLabel" name="labelId">
                                          <property name="geometry">
                                           <rect>
                                            <x>470</x>
                                            <y>70</y>
                                            <width>41</width>
                                            <height>16</height>
                                           </rect>
                                          </property>
                                          <property name="text">
                                           <string>0</string>
                                          </property>
                                         </widget>
                                         <widget class="QLabel" name="labelFsbSpeed">
                                          <property name="geometry">
                                           <rect>
                                            <x>470</x>
                                            <y>100</y>
                                            <width>41</width>
                                            <height>16</height>
                                           </rect>
                                          </property>
                                          <property name="text">
                                           <string>0</string>
                                          </property>
                                         </widget>
                                         <widget class="QLabel" name="labelMultiplier">
                                          <property name="geometry">
                                           <rect>
                                            <x>470</x>
                                            <y>130</y>
                                            <width>41</width>
                                            <height>16</height>
                                           </rect>
                                          </property>
                                          <property name="text">
                                           <string>0</string>
                                          </property>
                                         </widget>
                                         <widget class="QLabel" name="labelSpeed">
                                          <property name="geometry">
                                           <rect>
                                            <x>470</x>
                                            <y>160</y>
                                            <width>41</width>
                                            <height>16</height>
                                           </rect>
                                          </property>
                                          <property name="text">
                                           <string>0</string>
                                          </property>
                                         </widget>
                                         <widget class="QLabel" name="labelSpeed_2">
                                          <property name="geometry">
                                           <rect>
                                            <x>520</x>
                                            <y>160</y>
                                            <width>41</width>
                                            <height>16</height>
                                           </rect>
                                          </property>
                                          <property name="text">
                                           <string>MHz</string>
                                          </property>
                                         </widget>
                                         <widget class="QLabel" name="label_5">
                                          <property name="geometry">
                                           <rect>
                                            <x>10</x>
                                            <y>10</y>
                                            <width>16</width>
                                            <height>16</height>
                                           </rect>
                                          </property>
                                          <property name="text">
                                           <string>#</string>
                                          </property>
                                         </widget>
                                         <widget class="QLabel" name="label_10">
                                          <property name="geometry">
                                           <rect>
                                            <x>10</x>
                                            <y>40</y>
                                            <width>16</width>
                                            <height>16</height>
                                           </rect>
                                          </property>
                                          <property name="text">
                                           <string>0</string>
                                          </property>
                                         </widget>
                                         <widget class="QLabel" name="label_11">
                                          <property name="geometry">
                                           <rect>
                                            <x>10</x>
                                            <y>80</y>
                                            <width>16</width>
                                            <height>16</height>
                                           </rect>
                                          </property>
                                          <property name="text">
                                           <string>1</string>
                                          </property>
                                         </widget>
                                         <widget class="QLabel" name="label_12">
                                          <property name="geometry">
                                           <rect>
                                            <x>10</x>
                                            <y>120</y>
                                            <width>16</width>
                                            <height>16</height>
                                           </rect>
                                          </property>
                                          <property name="text">
                                           <string>2</string>
                                          </property>
                                         </widget>
                                         <widget class="QLabel" name="label_13">
                                          <property name="geometry">
                                           <rect>
                                            <x>10</x>
                                            <y>160</y>
                                            <width>16</width>
                                            <height>16</height>
                                           </rect>
                                          </property>
                                          <property name="text">
                                           <string>3</string>
                                          </property>
                                         </widget>
                                         <widget class="QLabel" name="labelName">
                                          <property name="geometry">
                                           <rect>
                                            <x>10</x>
                                            <y>200</y>
                                            <width>541</width>
                                            <height>16</height>
                                           </rect>
                                          </property>
                                          <property name="text">
                                           <string>Name</string>
                                          </property>
                                         </widget>
                                        </widget>
                                        <widget class="QStatusBar" name="statusbar"/>
                                       </widget>
                                       <resources/>
                                       <connections/>
                                      </ui>
                                      

                                      I'd like to say a big thank you to @SGaist, @JonB & especially @VRonin. I'd probaly still be scratching my head, wondering why the structure still isn't being populated without you guys!

                                      JonBJ 1 Reply Last reply
                                      2
                                      • R Ryan R

                                        At least we got there in the end!

                                        For anyone else wanting to make a PC monitoring system, I am releasing the full test project for Core Temp Shared Memory below.

                                        • Make sure Core Temp is installed & running. I use the following settings: enable plug-ins, start core temp with Windows, start core temp minimized.
                                        • You must tick "Enable global shared memory (SNMP)" inside Core Temp advanced settings!
                                        • Make sure you're using MSVC compiler; I used 2017 32-bit on Qt 5.14.2, Windows 10 64-bit .
                                        • Download the library and put it somewhere useful (No spaces, in a directory with a short file path).
                                        • Import the library by right clicking the project; external library, untick Linux & Mac.
                                        • Point the library file path to the folder corrosponding to your architecture (x86 or x64), depending on your compiler. Example "C:\CoreTempLib\x86".
                                        • Point the include path to the root directory of the library (should have Borland, x64, x86 & GetCoreTempInfo.h inside). Example "C:\CoreTempLib".
                                        • Now you can insert the header files "windows.h" and "GetCoreTempInfo.h" and use the library.
                                                    CORE_TEMP_SHARED_DATA* pct=&ct;
                                                    fnGetCoreTempInfo(pct);
                                        
                                        qDebug() << "Core 0 Temperature: "<< ct.fTemp[0] << " C.";
                                        

                                        f78f9358-9b96-4b7f-acee-ba8452ab49ab-image.png

                                        I made this quick project with C++/XML. It uses QThread and grabs the CPU data every second and pushes it to the GUI, without blocking it. Some of the code is messy, but it's just a quick example so other people don't have to go through this! If I've done anything dramatically wrong (like use Mutex incorrectly), I'm not sure if people can still post on this topic after I mark it as solved, so just PM me and I should be able to make the edits. Feel free to use any of the code below however you want.

                                        QtCoreTempTest.pro

                                        QT       += core gui
                                        
                                        greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
                                        
                                        CONFIG += c++11
                                        
                                        DEFINES += QT_DEPRECATED_WARNINGS
                                        
                                        SOURCES += \
                                            cputhread.cpp \
                                            main.cpp \
                                            mainwindow.cpp
                                        
                                        HEADERS += \
                                            cputhread.h \
                                            mainwindow.h
                                        
                                        FORMS += \
                                            mainwindow.ui
                                        
                                        # Default rules for deployment.
                                        qnx: target.path = /tmp/$${TARGET}/bin
                                        else: unix:!android: target.path = /opt/$${TARGET}/bin
                                        !isEmpty(target.path): INSTALLS += target
                                        
                                        
                                        win32: LIBS += -L$$PWD/../../../../../../CoreTempLib/x86/ -lGetCoreTempInfo
                                        
                                        INCLUDEPATH += $$PWD/../../../../../../CoreTempLib
                                        DEPENDPATH += $$PWD/../../../../../../CoreTempLib/x86
                                        

                                        mainwindow.h

                                        #ifndef MAINWINDOW_H
                                        #define MAINWINDOW_H
                                        
                                        #include <QMainWindow>
                                        #include <QDebug>
                                        #include <QString>
                                        #include <QVariant>
                                        #include <QByteArray>
                                        #include <QMutex>
                                        #include <QThread>
                                        
                                        #include <stdio.h>
                                        
                                        #include "cputhread.h"
                                        
                                        QT_BEGIN_NAMESPACE
                                        namespace Ui { class MainWindow; }
                                        QT_END_NAMESPACE
                                        
                                        class MainWindow : public QMainWindow
                                        {
                                            Q_OBJECT
                                        
                                        public:
                                            MainWindow(QWidget *parent = nullptr);
                                            ~MainWindow();
                                            CPUThread *mCPUThread;
                                        
                                        public slots:
                                            void onValueChanged(int, int, int, int, float, float, float, float, int, int, float, float, float, float, char, char, QString);
                                        
                                        private:
                                            Ui::MainWindow *ui;
                                        };
                                        #endif // MAINWINDOW_H
                                        

                                        mainwindow.cpp

                                        #include "mainwindow.h"
                                        #include "ui_mainwindow.h"
                                        
                                        
                                        MainWindow::MainWindow(QWidget *parent)
                                            : QMainWindow(parent)
                                            , ui(new Ui::MainWindow)
                                        {
                                            ui->setupUi(this);
                                        
                                            ui->labelInfo->setText("You must install the Core Temp SDK and import the libraries for this to work! <br /> <a href=\"http://alcpu.com/CoreTemp/developers.html\">SDK</a> <br /><br /> <a href=\"https://forum.qt.io/topic/115469/core-temp-shared-memory-in-qt-c-windows/24\">Forum</a>   ");
                                            ui->labelInfo->setTextFormat(Qt::RichText);
                                            ui->labelInfo->setTextInteractionFlags(Qt::TextBrowserInteraction);
                                            ui->labelInfo->setOpenExternalLinks(true);
                                        
                                            mCPUThread = new CPUThread(this);
                                        
                                            connect(mCPUThread, SIGNAL(valueChanged(int, int, int, int, float, float, float, float, int, int, float, float, float, float, char, char, QString)), this, SLOT(onValueChanged(int, int, int, int, float, float, float, float, int, int, float, float, float, float, char, char, QString)));
                                        
                                            mCPUThread->start();
                                        }
                                        
                                        void MainWindow::onValueChanged(int cpuLoad0, int cpuLoad1, int cpuLoad2, int cpuLoad3, float cpuTemp0, float cpuTemp1, float cpuTemp2, float cpuTemp3, int cpuTjMax, int cpuCoreCount, float cpuID, float cpuFsbSpeed, float cpuMultiplier, float cpuSpeed, char cpuFah, char cpuDeltaToMax, QString cpuName)
                                        {
                                            qDebug() << "From Thread: " << cpuLoad0 << "," << cpuLoad1 << "," << cpuLoad2 << "," << cpuLoad3 << "," << cpuTemp0 << "," << cpuTemp1 << "," << cpuTemp2 << "," << cpuTemp3 << "," << cpuTjMax << "," << cpuCoreCount << "," <<  cpuID << "," << cpuFsbSpeed << "," << cpuMultiplier << "," << cpuSpeed << "," << cpuFah << "," << cpuDeltaToMax << "," << cpuName << ".";
                                            ui->cpuLoad0->setValue(cpuLoad0);
                                            ui->cpuLoad1->setValue(cpuLoad1);
                                            ui->cpuLoad2->setValue(cpuLoad2);
                                            ui->cpuLoad3->setValue(cpuLoad3);
                                        
                                            ui->cpuTemp0->setValue(cpuTemp0);
                                            ui->cpuTemp1->setValue(cpuTemp1);
                                            ui->cpuTemp2->setValue(cpuTemp2);
                                            ui->cpuTemp3->setValue(cpuTemp3);
                                        
                                            ui->labelTjMax->setText(QString::number(cpuTjMax));
                                            ui->labelCoreCount->setText(QString::number(cpuCoreCount));
                                            ui->labelId->setText(QString::number(cpuID));
                                            ui->labelFsbSpeed->setText(QString::number(cpuFsbSpeed));
                                            ui->labelMultiplier->setText(QString::number(cpuMultiplier));
                                            ui->labelSpeed->setText(QString::number(cpuSpeed));
                                            ui->labelName->setText(cpuName);
                                        }
                                        
                                        MainWindow::~MainWindow()
                                        {
                                            delete ui;
                                        }
                                        

                                        cputhread.h

                                        #ifndef CPUTHREAD_H
                                        #define CPUTHREAD_H
                                        
                                        
                                        #include <QObject>
                                        #include <QThread>
                                        #include <windows.h>
                                        #include <GetCoreTempInfo.h>
                                        
                                        // Counts from 1 to 100.
                                        
                                        class CPUThread : public QThread
                                        {
                                        Q_OBJECT
                                        public:
                                        CPUThread();
                                        explicit CPUThread(QObject *parent = 0, bool b = false);
                                        void run();
                                        
                                        // if Stop = true, the thread will break
                                        // out of the loop, and will be disposed
                                        bool Stop;
                                        
                                        signals:
                                        // To communicate with Gui Thread
                                        // we need to emit a signal
                                        void valueChanged(int, int, int, int, float, float, float, float, int, int, float, float, float, float, char, char, QString);
                                        
                                        public slots:
                                        
                                        };
                                        #endif // CPUTHREAD_H
                                        

                                        cputhread.cpp

                                        #include "cputhread.h"
                                        #include <QDebug>
                                        #include <QMutex>
                                        
                                        #include<stdio.h>
                                        
                                            CPUThread::CPUThread(QObject *parent, bool b) :
                                                QThread(parent), Stop(b)
                                            {
                                            }
                                        
                                           // run() will be called when a thread starts
                                            void CPUThread::run()
                                            {
                                                for(int i = 0; i <= 100; i++)
                                                {
                                                    QMutex mutex;
                                                    // prevent other threads from changing the "Stop" value
                                                    mutex.lock();
                                                    if(this->Stop) break;
                                                    mutex.unlock();
                                        
                                                    CORE_TEMP_SHARED_DATA ct;
                                                    CORE_TEMP_SHARED_DATA* pct=&ct;
                                                    fnGetCoreTempInfo(pct);
                                        
                                        
                                        
                                                    char cName[100] = "-1";
                                                    strcpy(cName, ct.sCPUName);
                                                    QString cpuName(cName);
                                        
                                                    emit valueChanged(ct.uiLoad[0], ct.uiLoad[1], ct.uiLoad[2], ct.uiLoad[3], ct.fTemp[0], ct.fTemp[1], ct.fTemp[2], ct.fTemp[3], ct.uiTjMax[0], ct.uiCoreCnt, ct.fVID, ct.fFSBSpeed, ct.fMultipier, ct.fCPUSpeed, ct.ucFahrenheit, ct.ucDeltaToTjMax, cpuName);
                                        
                                                    this->sleep(1);
                                        
                                                    if(i > 99)
                                                    {
                                                        i = 0;
                                                    }
                                                }
                                                run();
                                              }
                                        

                                        main.cpp

                                        #include "mainwindow.h"
                                        
                                        #include <QApplication>
                                        
                                        int main(int argc, char *argv[])
                                        {
                                            QApplication a(argc, argv);
                                            MainWindow w;
                                            w.show();
                                            return a.exec();
                                        }
                                        
                                        

                                        mainwindow.ui

                                        <?xml version="1.0" encoding="UTF-8"?>
                                        <ui version="4.0">
                                         <class>MainWindow</class>
                                         <widget class="QMainWindow" name="MainWindow">
                                          <property name="geometry">
                                           <rect>
                                            <x>0</x>
                                            <y>0</y>
                                            <width>712</width>
                                            <height>246</height>
                                           </rect>
                                          </property>
                                          <property name="windowTitle">
                                           <string>Core Temp Shared Memory</string>
                                          </property>
                                          <widget class="QWidget" name="centralwidget">
                                           <widget class="QProgressBar" name="cpuLoad0">
                                            <property name="geometry">
                                             <rect>
                                              <x>40</x>
                                              <y>40</y>
                                              <width>118</width>
                                              <height>23</height>
                                             </rect>
                                            </property>
                                            <property name="value">
                                             <number>0</number>
                                            </property>
                                           </widget>
                                           <widget class="QProgressBar" name="cpuLoad1">
                                            <property name="geometry">
                                             <rect>
                                              <x>40</x>
                                              <y>80</y>
                                              <width>118</width>
                                              <height>23</height>
                                             </rect>
                                            </property>
                                            <property name="value">
                                             <number>0</number>
                                            </property>
                                           </widget>
                                           <widget class="QProgressBar" name="cpuLoad2">
                                            <property name="geometry">
                                             <rect>
                                              <x>40</x>
                                              <y>120</y>
                                              <width>118</width>
                                              <height>23</height>
                                             </rect>
                                            </property>
                                            <property name="value">
                                             <number>0</number>
                                            </property>
                                           </widget>
                                           <widget class="QProgressBar" name="cpuLoad3">
                                            <property name="geometry">
                                             <rect>
                                              <x>40</x>
                                              <y>160</y>
                                              <width>118</width>
                                              <height>23</height>
                                             </rect>
                                            </property>
                                            <property name="value">
                                             <number>0</number>
                                            </property>
                                           </widget>
                                           <widget class="QLabel" name="label">
                                            <property name="geometry">
                                             <rect>
                                              <x>40</x>
                                              <y>10</y>
                                              <width>151</width>
                                              <height>16</height>
                                             </rect>
                                            </property>
                                            <property name="text">
                                             <string>Physical Core Load</string>
                                            </property>
                                           </widget>
                                           <widget class="QProgressBar" name="cpuTemp2">
                                            <property name="geometry">
                                             <rect>
                                              <x>200</x>
                                              <y>120</y>
                                              <width>118</width>
                                              <height>23</height>
                                             </rect>
                                            </property>
                                            <property name="value">
                                             <number>0</number>
                                            </property>
                                            <property name="format">
                                             <string>%p C</string>
                                            </property>
                                           </widget>
                                           <widget class="QLabel" name="label_2">
                                            <property name="geometry">
                                             <rect>
                                              <x>200</x>
                                              <y>10</y>
                                              <width>151</width>
                                              <height>16</height>
                                             </rect>
                                            </property>
                                            <property name="text">
                                             <string>Physical Core Load</string>
                                            </property>
                                           </widget>
                                           <widget class="QProgressBar" name="cpuTemp0">
                                            <property name="geometry">
                                             <rect>
                                              <x>200</x>
                                              <y>40</y>
                                              <width>118</width>
                                              <height>23</height>
                                             </rect>
                                            </property>
                                            <property name="styleSheet">
                                             <string notr="true"/>
                                            </property>
                                            <property name="value">
                                             <number>0</number>
                                            </property>
                                            <property name="format">
                                             <string>%p C</string>
                                            </property>
                                           </widget>
                                           <widget class="QProgressBar" name="cpuTemp3">
                                            <property name="geometry">
                                             <rect>
                                              <x>200</x>
                                              <y>160</y>
                                              <width>118</width>
                                              <height>23</height>
                                             </rect>
                                            </property>
                                            <property name="value">
                                             <number>0</number>
                                            </property>
                                            <property name="format">
                                             <string>%p C</string>
                                            </property>
                                           </widget>
                                           <widget class="QProgressBar" name="cpuTemp1">
                                            <property name="geometry">
                                             <rect>
                                              <x>200</x>
                                              <y>80</y>
                                              <width>118</width>
                                              <height>23</height>
                                             </rect>
                                            </property>
                                            <property name="value">
                                             <number>0</number>
                                            </property>
                                            <property name="format">
                                             <string>%p C</string>
                                            </property>
                                           </widget>
                                           <widget class="QLabel" name="label_3">
                                            <property name="geometry">
                                             <rect>
                                              <x>350</x>
                                              <y>10</y>
                                              <width>121</width>
                                              <height>16</height>
                                             </rect>
                                            </property>
                                            <property name="text">
                                             <string>tjMax:</string>
                                            </property>
                                           </widget>
                                           <widget class="QLabel" name="labelTjMax">
                                            <property name="geometry">
                                             <rect>
                                              <x>470</x>
                                              <y>10</y>
                                              <width>41</width>
                                              <height>16</height>
                                             </rect>
                                            </property>
                                            <property name="text">
                                             <string>0</string>
                                            </property>
                                           </widget>
                                           <widget class="QLabel" name="label_4">
                                            <property name="geometry">
                                             <rect>
                                              <x>350</x>
                                              <y>40</y>
                                              <width>121</width>
                                              <height>16</height>
                                             </rect>
                                            </property>
                                            <property name="text">
                                             <string>Core Count:</string>
                                            </property>
                                           </widget>
                                           <widget class="QLabel" name="labelCoreCount">
                                            <property name="geometry">
                                             <rect>
                                              <x>470</x>
                                              <y>40</y>
                                              <width>41</width>
                                              <height>16</height>
                                             </rect>
                                            </property>
                                            <property name="text">
                                             <string>0</string>
                                            </property>
                                           </widget>
                                           <widget class="QLabel" name="labelInfo">
                                            <property name="geometry">
                                             <rect>
                                              <x>570</x>
                                              <y>10</y>
                                              <width>121</width>
                                              <height>201</height>
                                             </rect>
                                            </property>
                                            <property name="text">
                                             <string>Loading...</string>
                                            </property>
                                            <property name="alignment">
                                             <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
                                            </property>
                                            <property name="wordWrap">
                                             <bool>true</bool>
                                            </property>
                                           </widget>
                                           <widget class="QLabel" name="label_6">
                                            <property name="geometry">
                                             <rect>
                                              <x>350</x>
                                              <y>70</y>
                                              <width>121</width>
                                              <height>16</height>
                                             </rect>
                                            </property>
                                            <property name="text">
                                             <string>ID:</string>
                                            </property>
                                           </widget>
                                           <widget class="QLabel" name="label_7">
                                            <property name="geometry">
                                             <rect>
                                              <x>350</x>
                                              <y>100</y>
                                              <width>121</width>
                                              <height>16</height>
                                             </rect>
                                            </property>
                                            <property name="text">
                                             <string>FSB Speed:</string>
                                            </property>
                                           </widget>
                                           <widget class="QLabel" name="label_8">
                                            <property name="geometry">
                                             <rect>
                                              <x>350</x>
                                              <y>130</y>
                                              <width>121</width>
                                              <height>16</height>
                                             </rect>
                                            </property>
                                            <property name="text">
                                             <string>Multiplier: </string>
                                            </property>
                                           </widget>
                                           <widget class="QLabel" name="label_9">
                                            <property name="geometry">
                                             <rect>
                                              <x>350</x>
                                              <y>160</y>
                                              <width>121</width>
                                              <height>16</height>
                                             </rect>
                                            </property>
                                            <property name="text">
                                             <string>CPU Speed:</string>
                                            </property>
                                           </widget>
                                           <widget class="QLabel" name="labelId">
                                            <property name="geometry">
                                             <rect>
                                              <x>470</x>
                                              <y>70</y>
                                              <width>41</width>
                                              <height>16</height>
                                             </rect>
                                            </property>
                                            <property name="text">
                                             <string>0</string>
                                            </property>
                                           </widget>
                                           <widget class="QLabel" name="labelFsbSpeed">
                                            <property name="geometry">
                                             <rect>
                                              <x>470</x>
                                              <y>100</y>
                                              <width>41</width>
                                              <height>16</height>
                                             </rect>
                                            </property>
                                            <property name="text">
                                             <string>0</string>
                                            </property>
                                           </widget>
                                           <widget class="QLabel" name="labelMultiplier">
                                            <property name="geometry">
                                             <rect>
                                              <x>470</x>
                                              <y>130</y>
                                              <width>41</width>
                                              <height>16</height>
                                             </rect>
                                            </property>
                                            <property name="text">
                                             <string>0</string>
                                            </property>
                                           </widget>
                                           <widget class="QLabel" name="labelSpeed">
                                            <property name="geometry">
                                             <rect>
                                              <x>470</x>
                                              <y>160</y>
                                              <width>41</width>
                                              <height>16</height>
                                             </rect>
                                            </property>
                                            <property name="text">
                                             <string>0</string>
                                            </property>
                                           </widget>
                                           <widget class="QLabel" name="labelSpeed_2">
                                            <property name="geometry">
                                             <rect>
                                              <x>520</x>
                                              <y>160</y>
                                              <width>41</width>
                                              <height>16</height>
                                             </rect>
                                            </property>
                                            <property name="text">
                                             <string>MHz</string>
                                            </property>
                                           </widget>
                                           <widget class="QLabel" name="label_5">
                                            <property name="geometry">
                                             <rect>
                                              <x>10</x>
                                              <y>10</y>
                                              <width>16</width>
                                              <height>16</height>
                                             </rect>
                                            </property>
                                            <property name="text">
                                             <string>#</string>
                                            </property>
                                           </widget>
                                           <widget class="QLabel" name="label_10">
                                            <property name="geometry">
                                             <rect>
                                              <x>10</x>
                                              <y>40</y>
                                              <width>16</width>
                                              <height>16</height>
                                             </rect>
                                            </property>
                                            <property name="text">
                                             <string>0</string>
                                            </property>
                                           </widget>
                                           <widget class="QLabel" name="label_11">
                                            <property name="geometry">
                                             <rect>
                                              <x>10</x>
                                              <y>80</y>
                                              <width>16</width>
                                              <height>16</height>
                                             </rect>
                                            </property>
                                            <property name="text">
                                             <string>1</string>
                                            </property>
                                           </widget>
                                           <widget class="QLabel" name="label_12">
                                            <property name="geometry">
                                             <rect>
                                              <x>10</x>
                                              <y>120</y>
                                              <width>16</width>
                                              <height>16</height>
                                             </rect>
                                            </property>
                                            <property name="text">
                                             <string>2</string>
                                            </property>
                                           </widget>
                                           <widget class="QLabel" name="label_13">
                                            <property name="geometry">
                                             <rect>
                                              <x>10</x>
                                              <y>160</y>
                                              <width>16</width>
                                              <height>16</height>
                                             </rect>
                                            </property>
                                            <property name="text">
                                             <string>3</string>
                                            </property>
                                           </widget>
                                           <widget class="QLabel" name="labelName">
                                            <property name="geometry">
                                             <rect>
                                              <x>10</x>
                                              <y>200</y>
                                              <width>541</width>
                                              <height>16</height>
                                             </rect>
                                            </property>
                                            <property name="text">
                                             <string>Name</string>
                                            </property>
                                           </widget>
                                          </widget>
                                          <widget class="QStatusBar" name="statusbar"/>
                                         </widget>
                                         <resources/>
                                         <connections/>
                                        </ui>
                                        

                                        I'd like to say a big thank you to @SGaist, @JonB & especially @VRonin. I'd probaly still be scratching my head, wondering why the structure still isn't being populated without you guys!

                                        JonBJ Offline
                                        JonBJ Offline
                                        JonB
                                        wrote on last edited by JonB
                                        #26

                                        @Ryan-R said in Core Temp Shared Memory in Qt C++ - Windows:

                                        For anyone else wanting to make a PC monitoring system, I am releasing the full test project for Core Temp Shared Memory below.

                                        All looks good! I don't get hardware/devices, so this is novel for me. Is this used for measuring my core temperature to see if I have virus or something?

                                        1 Reply Last reply
                                        1
                                        • R Offline
                                          R Offline
                                          Ryan R
                                          wrote on last edited by Ryan R
                                          #27

                                          Well originally I used LabVIEW and created this:

                                          692aa16c-6c00-4f79-be97-2dcfa011b58f-image.png

                                          The aim was to create a program that sticks to the Desktop and can be overlayed on top of games. The issue with LabVIEW is that the runtime engine is quite bloated, so running that program with 4K games wasn't an option without losing FPS.

                                          My plan is to re-create the program in Qt C++ with XML and CSS.

                                          I'm sure there are a few other gamers out there that are curious about making something like this, since you can get it to display warnings, Windows notifications, ect.. with Qt.

                                          I'm also going to hook it up to my dedicated server with MySQL, so all of the data collected gets logged to a web panel. Then I can make a "lite" version of the program on my companies embedded PCs around the world for real-time data logging, remote control and firmware updates.

                                          1 Reply Last reply
                                          0

                                          • Login

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • Users
                                          • Groups
                                          • Search
                                          • Get Qt Extensions
                                          • Unsolved