Page 1 of 2

TeeChart not drawing to a device context

Posted: Thu May 30, 2013 7:40 pm
by 16660333
Hello,

There is a problem with TeeChart not drawing to a device context. This problem was introduced in v2012.

Below is a code snippet from our OnPaint call (where CChildView is a derived CWnd class).

Code: Select all

void CChildView::OnPaint() 
{
[snip]
      // Draw background
      pDC->FillSolidRect(rclChart, RGB(0xff, 0xff, 0xff));
      ...

      // Draw Chart
      HDC hdc = pDC->m_hDC;
      pChartData->Draw((long)hdc, rclChart.left, rclChart.top, rclChart.right, rclChart.bottom);
[snip]
}
The problem is that the chart is only drawn some of the time (about 60-90% of the time). The rest of the time, only the background is shown. This problem appears in "TeeChart Pro v2012 ActiveX Control" and "TeeChart Pro v2013 ActiveX Control". "TeeChart Pro v2011 ActiveX Control" works fine.

I have attached a program and source code that demonstrates the problem.

To reproduce it:

Register TeeChart2011.ocx
Run SteemaChartBugDemo.exe
-- Resize the window, multiple times, as well as selecting "View->Refresh" from the main window. The page should draw itself as expected.

Now Register TeeChart2012.ocx or TeeChart2013.ocx
Run SteemaChartBugDemo.exe
-- When you resize or refresh the window, you will notice that the chart isn't drawn over the background image all the time. It might work up to 90% of the time, but eventually you will see that the chart isn't drawn on top of the background image.

Let me know if you need any more help in reproducing this bug. Thank you!

Re: TeeChart not drawing to a device context

Posted: Fri May 31, 2013 10:31 am
by yeray
Hello,
jbritt wrote:I have attached a program and source code that demonstrates the problem.
I can't see it. Where did you upload it?

Re: TeeChart not drawing to a device context

Posted: Fri May 31, 2013 4:02 pm
by 16660333
I'm sorry. I tried 4 times to upload the attachment, and the website crashed each time. I sent an email to webmaster@teechart.net about it, and I'm hoping it can be resolved. Is there another way I can ftp the source code to you?

Re: TeeChart not drawing to a device context

Posted: Mon Jun 03, 2013 7:46 am
by narcis
Hi jbritt,

You can post your files here.

Thanks in advance.

Re: TeeChart not drawing to a device context

Posted: Mon Jun 03, 2013 7:48 pm
by 16660333
Hmm.. The link does not appear to be working either. I tried four different browsers and was unsuccessful each time I clicked on the link. I was never given a cue to enter a file, but got the message "could not connect to www.steema.net".

I'll try again to upload the source code, but this time it will be a smaller subset of the source code, and hopefully this will be enough information for you to build the demo program. When I tried to upload a zip file of the entire source I kept getting the message "Internal Server Error". When I tried to upload a single file, I got messages such as "The extension .cpp is not allowed", (and same result for txt and cpp_ extensions as well). Hopefully this one will work!

Re: TeeChart not drawing to a device context

Posted: Mon Jun 03, 2013 8:11 pm
by 16660333
Yay! It looks like the source code was successfully uploaded. I tried to upload a zipped file of the executable, but it appears that it is too big, so I'm hoping that the source code will be enough to build and reproduce this problem.

This code was built using Microsoft Developer Studio 2010, and you will want to mostly look at the file ChildView.cpp (particularly at the OnPaint() call).

Let me know if there is anything else you'll need to build and reproduce this bug.

Thanks!

Re: TeeChart not drawing to a device context

Posted: Thu Jun 06, 2013 5:43 pm
by 16660333
Hello,

Could you please give me an update on any progress of fixing this bug? Were you able to build it and reproduce it? Is there an estimate on how long it will take to fix it? If there is any more information you need from our end, we'd be happy to help.

Thank you!

Re: TeeChart not drawing to a device context

Posted: Fri Jun 07, 2013 7:04 am
by yeray
Hi,

I'm sorry for the delay here. We could reproduce the problem with your application and we are investigating what's wrong.
I'm afraid I can't tell you when this will be fixed.

Re: TeeChart not drawing to a device context

Posted: Fri Jun 07, 2013 3:18 pm
by 16660333
Thanks for update, and good luck! Please keep us informed.

Re: TeeChart not drawing to a device context

Posted: Tue Jun 11, 2013 9:44 am
by yeray
Hello,

I've seen the chart is always drawn with TeeChart ActiveX v2011.0.0.5 and starts failing some times at v2012.0.0.6.
I've been looking at your application but I'm not sure to understand why do you draw the chart manually at the OnPaint event.
Find attached an example where we create the TChart in a CWnd
MFCCreateTChartComponentOnFormAtRuntime.zip
(30.56 KiB) Downloaded 1044 times

Re: TeeChart not drawing to a device context

Posted: Tue Jun 11, 2013 5:38 pm
by 16660333
Hello,

Thanks for responding, and I hope we can solve this problem soon.

I looked at the sample program that you gave us,but this solution will not work for our us. (The sample that I gave you is a very simple program that demonstrates the problem that we are seeing, but is not our final application).

In our application, we draw several layers of components, and TeeChart is just one of them, and we need to be able to draw to a device context. We used to be able to do that in TeeChart Pro v8 and TeeChart Pro v2011. We noticed that the latest build (Build 2013.0.1.1) demonstrates the problem as well.

Again, good luck in solving this!

Thanks!

Re: TeeChart not drawing to a device context

Posted: Wed Jul 24, 2013 3:11 pm
by Marc
Hello,

As a followup just to let you know that unfortunately we haven't yet found the cause of the problem which is proving very elusive, but that we are still actively investigating.

Regards,
Marc Meumann

Re: TeeChart not drawing to a device context

Posted: Fri Jul 26, 2013 1:28 pm
by yeray
Hello,

We've found a possible fix for this. We'll contact you next Monday to send you a test version.

Re: TeeChart not drawing to a device context

Posted: Fri Jul 26, 2013 4:43 pm
by 16660333
Awesome! Thank you, and I'm looking forward to it!

Re: TeeChart not drawing to a device context

Posted: Mon Jul 29, 2013 9:17 am
by yeray
Hi Britt,

I've just sent you a mail with the test version.