ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  calling chartdirector(C++) dll from Go
Posted by Bernd Engelmann on Aug-18-2015 22:37
Attachments:
Hi Peter,

Go calling C functions from chartdirector(C++) dll
(see https://github.com/golang/go/wiki/WindowsDLLs)
works in principle, chartdirectortest.go and test.png are attached.

However, title and names in the legendbox do not show up.

I am asking, just in case, that you have some advice, though this approach may not be
supported.

Thanks,
Bernd
chartdirectortest.go
chartdirectortest.go

3.16 Kb
    
test.png

  Re: calling chartdirector(C++) dll from Go
Posted by Peter Kwan on Aug-18-2015 23:17
Hi Bernd,

I have never used "Go" before and are not sure how to use it. Anyway, just by reading your
code, I see the following code which I do not understand fully:

(a) For the addTitle, the font size is set to uintptr(12.0). I am not sure what is uintptr, as
the font size should be an integer. (The uintptr seems to suggest an integer pointer.) But
then the uintptr seems to work in your code as the chart can be plotted normally. Anyway,
I suspect uintptr(12.0) should be uintptr(12).  (The number 12 should be an integer.) May
be "Go" translate the 12.0 to uintptr differently.

(b) For the addLegend, the font size seems to be set to 0 using uintptr(0). May be you can
try:

chartdir.NewProc("CBaseChart_addTitle").Call(cbase, Str("Genetically Modified Predator"),
Str("normal"), uintptr(12), uintptr(0x000000), uintptr(0xFF000000), uintptr(0xFF000000))

(c) I am also not sure if the Str function is working, as I do not understand "Go". From
online documention, it seems there is a function that can convert "Go" string to "C" string.
May be you can try just to make sure to see if the text can appear.

func C.CString(goString string) *C.char

Regards
Peter Kwan