Unicode problem with TeeChart v8.0.0.3

TeeChart for ActiveX, COM and ASP
Post Reply
Studylog
Newbie
Newbie
Posts: 4
Joined: Mon May 12, 2008 12:00 am

Unicode problem with TeeChart v8.0.0.3

Post by Studylog » Mon May 12, 2008 3:49 pm

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.

Yeray
Site Admin
Site Admin
Posts: 9543
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Post by Yeray » Tue May 13, 2008 8:54 am

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?
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Studylog
Newbie
Newbie
Posts: 4
Joined: Mon May 12, 2008 12:00 am

Post by Studylog » Tue May 13, 2008 1:33 pm

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.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue May 13, 2008 3:14 pm

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.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Studylog
Newbie
Newbie
Posts: 4
Joined: Mon May 12, 2008 12:00 am

Post by Studylog » Thu May 15, 2008 10:16 am

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.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Mon May 26, 2008 9:46 am

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.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Studylog
Newbie
Newbie
Posts: 4
Joined: Mon May 12, 2008 12:00 am

Post by Studylog » Mon May 26, 2008 11:20 am

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?

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue May 27, 2008 7:32 am

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.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply