Jump to content

Search the Community

Showing results for tags 'OpenHardwareMonitorLib.dll'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 1 result

  1. Hi guys, I'm trying to use the Open Hardware Monitor library to read some values about the hardware. I know that I could run directly OpenHardwareMonitor.exe and read from WMI but I want to use the library. It is written in C# but I've read from >this topic I can use RegAsm to register the types in the registry so I could run the classes in the library as COM objects. I've downloaded the source, changed COMVISIBLE property to TRUE and compiled the library with MSBuild.exe I would convert this (or this) script to Autoit but after some lines of code I get an error: "Invalid pointer". I don't understand why I get that error, I don't think it's cause RegAsm because it gives me a warning but then it does its job registering the types. #RequireAdmin $RegAsm_path = "C:\Windows\Microsoft.NET\Framework\v4.0.30319\regasm" ; CHECK YOUR VERSION!!! $foo = Run($RegAsm_path & " /codebase /nologo OpenHardwareMonitorlib.dll", "", @SW_HIDE, 0x2 + 0x4) $std = _Read_Std($foo) MsgBox(0,$foo,$std) $oMyError = ObjEvent("AutoIt.Error","MyErrFunc") $cp = ObjCreate("OpenHardwareMonitor.Hardware.Computer") If IsObj($cp) Then MsgBox(0,"OpenHardwareMonitor.Hardware.Computer","Object created") $cp.Open() ; <--------------- ERROR RunWait($RegAsm_path & " /nologo /unregister OpenHardwareMonitorlib.dll", "", @SW_HIDE) Func MyErrFunc() $HexNumber=hex($oMyError.number,8) Msgbox(0,"","We intercepted a COM Error !" & @CRLF & _ "Number is: " & $HexNumber & @CRLF & _ "Windescription is: " & $oMyError.windescription & @CRLF & _ "Source is: " & $oMyError.source & @CRLF & _ "Description is: " & $oMyError.description & @CRLF & _ "Script line is: " & $oMyError.scriptline) RunWait($RegAsm_path & " /nologo /unregister OpenHardwareMonitorlib.dll", "", @SW_HIDE) Exit Endfunc Func _Read_Std($handle) Local $s While 1 $s &= StdoutRead($handle) If @error Then ExitLoop $s &= StderrRead($handle) If @error Then ExitLoop WEnd Return $s EndFunc I'll attach the compiled dll but you need to check .NET Framework folder first. Thank you at all.
×
×
  • Create New...