Page 1 of 1

Using TeeChart with Win32 console applications

Posted: Tue Sep 09, 2008 3:00 pm
by 15048301
I'm trying to use TeeChart to generate bitmaps for reports in a Win32 console application, and I've run into a rather puzzling snag.

Up to a point everything appears to be working - the chart is created (using CreateInstance(TeeChart::CLSID_TChart) ), configured etc. as expected.

However, when we try to save the chart as a bitmap, we're receiving an E_UNEXPECTED result (irrespective of format - we're aiming for .PNG, but I've also tried several others including .BMP, which should not require any supporting DLLs).

The interesting thing is that the same (actually, it's absolutely identical!) code is working quite happily in one of our other projects (not a console app), so lacking additional information I'm assuming whatever is wrong is likely to be something to do with running in a console application environment.

Has anyone here successfully got TeeChart working in a console app? If so, I'd be interested to hear of any issues you ran into along the way.

Thanks in advance,

Anna

Posted: Mon Sep 15, 2008 11:03 am
by narcis
Hi Anna,

You shouldn't expect any problem with that. Could you please send us a simple example project we can run "as-is" to reproduce the problem here?

You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.

Thanks in advance.

Was the console app problem ever resolved?

Posted: Mon Sep 15, 2008 3:47 pm
by 15046194
narcis wrote:Hi Anna,

You shouldn't expect any problem with that. Could you please send us a simple example project we can run "as-is" to reproduce the problem here?

You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.

Thanks in advance.
We want to create charts and save them as gif files using a console app.

We have used TeeChart in the past in a VB6 window app but have upgraded to Visual Studio.Net 2005 from VB6 and are hoping to use our current version of ActiveX TeeChart v8.0.0.4 with VS 2005.

Question 1 - Can TeeChartv8.0.0.4 ActiveX create charts and save as .gif files in a VS 2005 console app?

Question 2 - Any advice on perhaps a different approach?

Posted: Tue Sep 16, 2008 7:24 am
by narcis
Hi npsAir,

Please find below the answers to your questions.
Question 1 - Can TeeChartv8.0.0.4 ActiveX create charts and save as .gif files in a VS 2005 console app?
Yes, TeeChart v8 supports exporting to GIF. You just need to create a chart an export it as shown in Tutorial 12. Tutorials can be found at TeeChart's program group.
Question 2 - Any advice on perhaps a different approach?
Not that I can think of.

Posted: Tue Sep 16, 2008 8:34 am
by 15048301
narcis wrote:Hi Anna,

You shouldn't expect any problem with that. Could you please send us a simple example project we can run "as-is" to reproduce the problem here?

Thanks in advance.
Hi NarcĂ­s,

We're in the process of stripping down the code into something representative we can send you. In doing so we have actually uncovered part of the puzzle though.

The code in question subscribes for a couple of events (mainly for legend text customisation) using IDispEventImpl::DispEventAdvise(). If we disable the advise call everything else works OK (but of course the legend is incomplete). When we re-enable the advise call we get the E_UNEXPECTED return when saving.

I'll try to finish putting together the sample project over the next day or so.