Jump to content

DllCall and "Double" data type


Kram3r
 Share

Recommended Posts

Hi ! I'm trying to do an UDF for RMChart Dll. RMChart is freeware and makes really good

looking charts. (http://www.rmchart.com/)

I've a function on this dll thats requires the Double data type for two of its arguments,

is there any work around to use this function since DllCall not allow double type ?

THKZ

Func _RMC_AddDataAxis($nCtrlId,$nRegion,$nAlignment=0,$nMinvalue=0,$nMaxvalue=0, _
    $nTickcount=0,$nFontsize=0,$nTextcolor=0,$nLinecolor=0, $nLinestyle=0 , _
    $nDecimalDigits=0,$sUnit="",$sText="",$sLabels="",$nLabelAlignment=0)


$hdll = DllOpen("rmchart.dll")

$return=dllcall($hdll,"long","RMC_ADDDATAAXIS","long",$nCtrlId,"long", _
        $nRegion,"long",$nAlignment,"double",$nMinvalue,"double",$nMaxvalue, _
        "long", $nTickcount,"long",$nFontsize,"long",$nTextcolor,"long",$nLinecolor, _
        "long",$nLinestyle,"long",$nDecimalDigits,"str",$sUnit ,"str",$sText, _
        "str",$sLabels,"long",$nLabelAlignment)


#cs 
nResult (LONG) = RMC_AddDataAxis(
ByVal nCtrlId (LONG),
ByVal nRegion (LONG),
Optional ByVal nAlignment (LONG),
Optional ByVal nMinvalue (DOUBLE),
Optional ByVal nMaxvalue (DOUBLE),
Optional ByVal nTickcount (LONG),
Optional ByVal nFontsize (LONG),
Optional ByVal nTextcolor (LONG),
Optional ByVal nLinecolor (LONG),
Optional ByVal nLinestyle (LONG),
Optional ByVal nDecimalDigits (LONG),
Optional ByRef sUnit (ASCIIZ),
Optional ByRef sText (ASCIIZ),
Optional ByRef sLabels (ASCCIZ),
Optional ByRef nLabelAlignment (LONG)
)
#ce
;DllClose($hdll) ->make script hang in the 2 other calls of RMChart.dll
EndFunc
Edited by Kram3r

To all the Devs: Thkx for AutoIt To all Mods: Thkx for the quality forum

Link to comment
Share on other sites

Hi ! I'm trying to do an UDF for RMChart Dll. RMChart is freeware and makes really good

looking charts.

I've a function on this dll thats requires the Double data type for two of its arguments,

is there any work around to use this function since DllCall not allow double type ?

THKZ

Func _RMC_AddDataAxis($nCtrlId,$nRegion,$nAlignment=0,$nMinvalue=0,$nMaxvalue=0, _
    $nTickcount=0,$nFontsize=0,$nTextcolor=0,$nLinecolor=0, $nLinestyle=0 , _
    $nDecimalDigits=0,$sUnit="",$sText="",$sLabels="",$nLabelAlignment=0)
$hdll = DllOpen("rmchart.dll")

$return=dllcall($hdll,"long","RMC_ADDDATAAXIS","long",$nCtrlId,"long", _
        $nRegion,"long",$nAlignment,"double",$nMinvalue,"double",$nMaxvalue, _
        "long", $nTickcount,"long",$nFontsize,"long",$nTextcolor,"long",$nLinecolor, _
        "long",$nLinestyle,"long",$nDecimalDigits,"str",$sUnit ,"str",$sText, _
        "str",$sLabels,"long",$nLabelAlignment)
#cs 
nResult (LONG) = RMC_AddDataAxis(
ByVal nCtrlId (LONG),
ByVal nRegion (LONG),
Optional ByVal nAlignment (LONG),
Optional ByVal nMinvalue (DOUBLE),
Optional ByVal nMaxvalue (DOUBLE),
Optional ByVal nTickcount (LONG),
Optional ByVal nFontsize (LONG),
Optional ByVal nTextcolor (LONG),
Optional ByVal nLinecolor (LONG),
Optional ByVal nLinestyle (LONG),
Optional ByVal nDecimalDigits (LONG),
Optional ByRef sUnit (ASCIIZ),
Optional ByRef sText (ASCIIZ),
Optional ByRef sLabels (ASCCIZ),
Optional ByRef nLabelAlignment (LONG)
)
#ce
;DllClose($hdll) ->make script hang in the 2 other calls of RMChart.dll
EndFunc
Not sure but have you tried "int"?
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

I do now martin, thks for the tip, but still no luck.

Double type have 8 bytes, i think the problem lies there.

I think i have no others errors on dll call.

To all the Devs: Thkx for AutoIt To all Mods: Thkx for the quality forum

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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