2011-12-26 11 views
0

我想檢測我的視頻卡GPU溫度。 所以我想使用nvcpl.dll添加它作爲我的代碼的參考。試圖檢測視頻卡GPU溫度但不能添加引用nvcpl.dll出現「無法添加」的錯誤

即時通訊使用Visual Studio 2010 Express和Windows 7

我發現在文件nvcpl.dll:C:\ Windows \ System32下 但是,當我嘗試添加文件作爲參考IM ggeting錯誤:

「的引用到d:\ nvcpl.dll不能添加請確保該文件是可訪問,並且它是一個有效的程序集或COM組件」我想也是先複製

文件到d:\ 我在谷歌嘗試了示例和代碼示例。

不知道如何使用dll。

+1

我想nvcpl.dll是一個本地DLL。 – 2011-12-26 03:35:57

回答

0

您可以在C#從Open Hardware Monitor項目在http://code.google.com/p/open-hardware-monitor/

Open Hardware Monitor

The Open Hardware Monitor is a free open source software that monitors temperature sensors, fan speeds, voltages, load and clock speeds of a computer.

The Open Hardware Monitor supports most hardware monitoring chips found on todays mainboards. The CPU temperature can be monitored by reading the core temperature sensors of Intel and AMD processors. The sensors of ATI and Nvidia video cards as well as SMART hard drive temperature can be displayed. The monitored values can be displayed in the main window, in a customizable desktop gadget, or in the system tray. The Open Hardware Monitor software runs on 32-bit and 64-bit Microsoft Windows XP/Vista/7 and any x86 based Linux operating systems without installation.

您需要用戶交互操作相似,這裏的例子代碼獲取GPU溫度圖(和這麼多)工作的源代碼: http://www.mp3car.com/coders-corner/107386-vb-net-screenorientation-angle180.html

從它看起來像你的實際需要調用NVIDIA的API文檔,我能很快找到(PDF from 2005)是:

NvCplGetThermalSettings()

函數原型

BOOL CDECL NvCplGetThermalSettings 
(IN UINT nWindowsMonitorNumber, 
OUT DWORD* pdwCoreTemp, 
OUT DWORD* pdwAmbientTemp, 
OUT DWORD* pdwUpperLimit); 

參數在UINT nWindowsMo​​nitorNumber - 上 Windows顯示屬性 - >設置頁中所示的顯示次數。

值爲0表示當前的主要Windows顯示設備。

  • DWORD *必須是一個有效的指針 -
  • pdwCoreTemp - GPU的溫度以攝氏度。
  • pdwAmbientTemp - 環境溫度(攝氏度)。
  • pdwUpperLimit - GPU溫度規格的上限。

返回值成功返回true。 失敗時出錯。