Jump to content

hkevin9

Members
  • Posts

    1
  • Joined

  • Last visited

Everything posted by hkevin9

  1. I used the rmchart.dll for an example. CODE#include <GUIConstants.au3> $Form1 = GUICreate("AForm1", 800, 600, 100, 20) $btnStart = GUICtrlCreateButton("&Start", 700, 500, 97, 33, 0) $obj1 = 10001 $oMyError = ObjEvent("AutoIt.Error","MyErrFunc") ; Initialize a COM error handler GUISetState(@SW_SHOW) $dll = DllOpen("rmchart.dll") While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $btnStart $result1 = dllcall($dll,"long","RMC_CREATECHARTFROMFILE","long",$form1,"long",$obj1,"long",0,"long",0,"long",0,"str","4 regions.rmc") $result1 = dllcall($dll,"long","RMC_DRAW","long",$obj1) EndSwitch WEnd DllClose($dll) ; This is my custom defined error handler Func MyErrFunc() $HexNumber=hex($oMyError.number,8) ; for displaying purposes Msgbox(0,"AutoItCOM Test","We intercepted a COM Error !" & @CRLF & @CRLF & _ "err.description is: " & @TAB & $oMyError.description & @CRLF & _ "err.number is: " & @TAB & $HexNumber & @CRLF & _ "err.scriptline is: " & @TAB & $oMyError.scriptline & @CRLF _ ) SetError(1) ; to check for after this function returns Endfunc
×
×
  • Create New...