Page 1 of 1

Unicode problem with TeeChart v8.0.0.3

Posted: Mon May 12, 2008 3:49 pm
by 15049003
Hi,
I got problem with TeeChart v8 unicode version while migrating from v6.
When I set chart header or subheader with GetHeader().SetCaption(str) or GeSubtHeader().SetCaption(str), I get correct text in Japanese.

However when I use CStrings methods like
.GetHeader().GetText().Add(str) or .GetHeader().GetText().SetText(str),
TeeChart renders question marks.

And one more problem I have with call to .Series(i).GetAsLine().GetPointer().GetBrush(). It fails with message "Member not found".

Could you please suggest something on this problems?

I'm using VS c++ 2005, TeeChart v8.0.0.3 unicode version.

Posted: Tue May 13, 2008 8:54 am
by yeray
Hi Studylog,

I've tested it for VB6 and I'm not able to reproduce it. Here is the code I used and works for me:

Code: Select all

Private Sub Form_Load()
Dim mystring As String
  TChart1.Aspect.View3D = False
  
  mystring = TChart1.Environment.CodeUTF8String("EXAMPLE " & TChart1.Environment.DecodeUTF8String("@U#4558414D504C45"), True)
  TChart1.Header.Caption = mystring
  TChart1.SubHeader.Text.Add mystring
  TChart1.Footer.Text.Text = mystring

  TChart1.AddSeries scLine
  TChart1.Series(0).FillSampleValues 25
  
  TChart1.Series(0).asLine.Pointer.Visible = True
  TChart1.Series(0).asLine.Pointer.Brush.Style = bsDiagSmall
  TChart1.Series(0).asLine.Pointer.Brush.Color = vbBlue
End Sub
I'm sorry it's in VB6 not in c++ but you shouldn't have many troubles in translating.

So, could you please send us a simple example project (in c++ if you prefer) we can run "as-is" to reproduce your problem here?

Posted: Tue May 13, 2008 1:33 pm
by 15049003
Thanks Yeray,

CodeUTF8String() fixes problem with unicode text.
I was confused with its usage because Header.Caption produce correct result without UTF8 coding.

However problem with missing "GetBrush()" member still remains.
I've created test project using VisualStudio 2005 and wonder how I can send it to you. Would support@steema.com be correct address?

Basically you need only to create dialog based MFC application project,
Than add to dialog TeeChart control and try to use the following code:

Code: Select all

m_Chart.AddSeries(scLine);
m_Chart.Series(0).FillSampleValues(25);
 
// This call returns "Member not found" error.
m_Chart.Series(0).GetAsLine().GetPointer().GetBrush();
where m_Chart is a CTChart variable bound to teechart control.

Posted: Tue May 13, 2008 3:14 pm
by narcis
Hi Studylog,

Have you added this line to your code?

Code: Select all

#include "Brush.h"
Code snippet below works fine for us here using TeeChart Pro v8.0.0.3 ActiveX. Is that the version you are using?

Code: Select all

	m_Chart1.AddSeries(scLine);
	m_Chart1.Series(1).FillSampleValues(10);
	m_Chart1.Series(1).GetAsLine().GetPointer().GetBrush().ShowEditor();
Thanks in advance.

Posted: Thu May 15, 2008 10:16 am
by 15049003
Hi Narcis,

Yes, I've included brush.h header.
And your test is correct. Exactly the same lines produce the exception I mentioned. Version also correct - 8.0.0.3.

I tried different combinations and different machines. Also I tested unicode, multi language unicode and regular versions. And all of them produce an error.

All I can think about is a mistake in the wrapper class.
Here is what I have in pointer.cpp:

Code: Select all

CBrush1 CPointer::GetBrush()
{
	LPDISPATCH pDispatch;
	InvokeHelper(0x1, DISPATCH_PROPERTYGET, VT_DISPATCH, (void*)&pDispatch, NULL);
	return CBrush1(pDispatch);
}
Is it possible that method ID (0x1 in our case) is wrong?

By the way, when I investigated the problem I found that CPointer::GetTransparency() also produces the same error.

Posted: Mon May 26, 2008 9:46 am
by narcis
Hi Studylog,

I've just sent a working example at your forums contact e-mail address. Could you please check if it works fine at your end?

Thanks in advance.

Posted: Mon May 26, 2008 11:20 am
by 15049003
Your example works fine and do not produce mentioned error. Although the code is absolutely the same.

I've fixed the problem with my code by replacing the stub classes I took from
...\TeeChart Pro v8 ActiveX Control\Utilities\New VC Classes\

with classes from your example.
Also I had to use some files from the previous set because in the example some files was missing.

There were around 40 different files, so it's hard to say where was the problem.

And just to be sure I won't get any problems in the future, could you please send me a full set of stub classes?

Posted: Tue May 27, 2008 7:32 am
by narcis
Hi Studylog,

When creating a new project you can automatically generate new header files when dropping TeeChart components in a dialog. Anyway, we will make sure all header files are up to date in the next maintenance release.