Search the Community
Showing results for tags 'DLL C\# C++'.
-
Hello, I'm trying to convert a C#C++ to Autoit, but since I don't understand neither of them (nor DLL for that matter) I'm having a hard time.. So, I hope some one can explain to me how to or convert a single function so I can build on it. C++ http://eliang.blogspot.com/2011/05/getting-nvidia-gpu-usage-in-c.html C# https://code.google.com/p/open-hardware-monitor/source/browse/trunk/Hardware/Nvidia/NVAPI.cs #include <Array.au3> #include <WinAPI.au3> Dim $DLL = DllOpen('nvapi.dll'), $NVAPI_MAX_PHYSICAL_GPUS = 64, $NVAPI_MAX_USAGES_PER_GPU = 34 Dim $NvStatus, $GpuCount, $GpuHanldes[ $NVAPI_MAX_PHYSICAL_GPUS ], $GpuUsages[ $NVAPI_MAX_USAGES_PER_GPU ] NvAPI_Initialize() $R = NvAPI_EnumPhysicalGPUs() _ArrayDisplay($GpuHanldes) MsgBox(0, '', $GpuCount) DllClose($DLL) Func NvAPI_Initialize() $result = DllCall($DLL, "int:cdecl", 'nvapi_QueryInterface', 'int', 0x0150E828, 'int', $NvStatus) If @error Then Exit MsgBox(16, 'Error!', 'Initialization Failed!' & @CRLF & @error) Return $result EndFunc Func NvAPI_EnumPhysicalGPUs() $result = DllCall($DLL, "int:cdecl", 'nvapi_QueryInterface', 'int', 0xE5AC921F, 'int', $GpuHanldes, 'int', $GpuCount) If @error Then Exit MsgBox(16, 'Error!', 'Enumeration Failed!' & @CRLF & @error) Return $result EndFunc Func NvAPI_GPU_GetUsages() $result = DllCall($DLL, "int:cdecl", 'nvapi_QueryInterface', 'int', 0x189A1FDF, 'int', $GpuHanldes[0], 'uint', $GpuUsages) If @error Then Exit MsgBox(16, 'Error!', 'Getting Usages Failed' & @CRLF & @error) Return $result EndFunc Thanks.