Jump to content
Software FX Community

Bug in ChartFX -- Export() must be called twice.

User (Legacy)

Recommended Posts


I am attaching the source of full C++ Windows application

that uses only core Windows functions and #imports

Cfx4032.dll, ver. (+ sfxbar.dll).

It demonstrates the observed strange situation of Export()

to WMF format. When the Export() is called for the first

time, the produced "chart.wmf" file looks like an extremely

small and empty square (probably border of the image). When

the same method is called second time immediately, the

result is correct. See the "chart1.wmf" for the case when one

Export() was commented out, and "chart2.wmf" when the

Export() was called twice -- included in the attached zip.

The last 20 lines of the source contain the mentioned code.

The return values are checked.

The application does not dispatch the messages from the

message loop, just calls the methods and exits. It looks

this way in pseudocode:


int WINAPI WinMain(...)


Create the Chart FX instance

Fill the instance with data

Create the invisible window for the instance

Remove the previously generated "chart.wmf"

hr = spChartFX->Export(ChartfxLib::CHART_METAFILE, "chart.wmf");


// Try to comment out the following line...

hr = spChartFX->Export(ChartfxLib::CHART_METAFILE, "chart.wmf");


MessageBox "The End."



Should anything else be called before the Export()? Am I

doing something wrong? Can you produce the same results?

Is it a bug?

Thanks for any information,



Petr Prikryl (prikrylp at skil dot cz)

Link to comment
Share on other sites

Thanks! That is exactly what I was searching for.

I thought that method like that could

exist but I was unsuccessful to find

the information by myself.

While the doc for UpdateSizeNow() explains

usage whe exporting, the documentation

for Export() does not mention the UpdateSizeNow().

It could possibly be added to "See also".

Thanks again,


"SoftwareFX Support" wrote...

> Try the following:


> spChartFX->UpdateSizeNow();


> Right before Export.

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...