Jump to content
Software FX Community

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


User (Legacy)
 Share

Recommended Posts

Hi,

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

that uses only core Windows functions and #imports

Cfx4032.dll, ver. 5.0.14.1 (+ 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(...)

CoInitialize

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");

assert(SUCCEEDED(hr));

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

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

assert(SUCCEEDED(hr));

MessageBox "The End."

CoUninitialize

---------------------------------------------

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

--

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,

Petr

"SoftwareFX Support" wrote...

> Try the following:

>

> spChartFX->UpdateSizeNow();

>

> Right before Export.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...