Jump to content
Software FX Community

Export function with Visual Studio .NET


User (Legacy)

Recommended Posts

Hi everyone,

I'm upgrading from Visual Studio 6.0 to Visual Studio

.NET 7.0 and I have some troubles with the export functions. My program

works perfectly in Windows 2000 and XP with Visual Studio 6.0 but not with

.NET. I create a file, I'm writing some text lines in it and after I want

to export Chart data from ChartFX Client-Server 5.0 into my file. Here's my

code:

CStdioFile savedFile (fileTemp, CFile::modeReadWrite |CFile::modeCreate);

savedFile.WriteString(_T("#\n"));

savedFile.SeekToEnd();

VT(&v) = VT_UI4;

V_UI4(&v) = savedFile;

m_pChartFX->Export(CHART_DATA,v);

savedFile.SeekToBegin();

This code works with VS6.0 but not with .NET, I don't understand. Can you

help me ?

Thanks a lot,

Ren

Link to comment
Share on other sites

This code doesn't work in ANY version of VC++.

The correct code would be:

CStdioFile savedFile ("d:\\temp\\filetest.cfx2", CFile::modeReadWrite

|CFile::modeCreate);

VARIANT v;

savedFile.WriteString(_T("#\n"));

savedFile.Flush();

savedFile.SeekToEnd();

V_VT(&v) = VT_UI4;

V_UI4(&v) = (ULONG) savedFile.m_hFile;

m_pChartFX->Export(CHART_DATA,v);

savedFile.SeekToBegin();

This code works in any VS 6.0 and VS 2003.

--

FP

Software FX

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...