Jump to content

Recommended Posts

Posted

Hi all,

I would like to use the activex object of RMChart (http://www.rmchart.com/) in autoit.

It has a lot of good functionalities in charting.

I tried to find something in the forum but this is the only thing I found (no help for me):

http://www.autoitscript.com/forum/index.ph...&hl=rmchart

I tried with this code:

; Script Start - Add your code below here
#include <GUIConstants.au3>
$oShell = ObjCreate("RMChart.RMChartX")

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("AForm1", 633, 454, 193, 115)
$GUIActiveX = GUICtrlCreateObj( $oShell, 10, 20, 350, 350)

 $oMyError = ObjEvent("AutoIt.Error","MyErrFunc")    ; Initialize a COM error handler

; COM Error Handler example
; -------------------------
$oShell.RMCFile="00003600|00004450|000051|000061|000072|00008-13408615|00009400|00011Tahoma|000122|100011|100035|100045|10005-5|10006-5|1000910|100101|100112|100131|100181|100481|10051-13312|10053-13312|10063-1|100652|100680|100690|100706|100718|1007612|100810|100820|100838|100848|100899|100950|10096100|1009711|100988|101040|10105100|1010611|101078|101131|10180Prova 1|10181Test 1|110011|1100270|1100473|110062|1101421|1102121|110221|110236|110241|110256|110271|110530*1*2*3*4*5|110540*2*3.5*6*4*5"
$oShell.Draw

GUISetState()
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd


; 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

Unfortunately I receive a lot of objects error.

I think I made some mistakes declaring the objects (it seems autoit cannot find some methods and properties).

Any ideas?

Thanks.

  • 4 months later...
Posted

nothing?

no one?

:)

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 an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...