Re:Compile error of sysvari.h
I am a beginner of COM/DCOM , I try to compile a test program from a
reference book, but there were errors and the errors are all about
sysvari.h, I did not change anything in this file. why?
I use BCB 5.0 pro.
In Form1 there is a DBGrid1 ,it's DataSource is Table1 which connect to
Animals.DBF of BCDDEMOS, and I put a Button1, I want to send the contents of
Table1 to Word using an Automation Server.
const wdSeparateByTabs=1;
const wdTableFormatProfessional=37;
TForm1 *Form1;
//--------------------------------------------------------------------------
-
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
//--------------------------------------------------------------------------
-
void __fastcall TForm1::Button1Click(TObject *Sender)
{
Variant vWord;
Variant vDocuments;
Variant vSelection;
AnsiString sStr;
vWord= CreateOleObject("Word.Application.8");
vDocuments=vWord.OlePropertyGet("Documents");
vWord.OlePropertySet("Visible",true);
sStr="|Wo\to??t\n";
Table1->First();
while(!Table1->Eof)
{
sStr=sStr+Table1->FieldByName("NAME")->AsString+"\t"+
Table1->FieldByName("AREA")->AsString+"\n";
Table1->Next();
vDocuments.Exec(Procedure("Add"));
vSelection=vWord.OlePropertyGet("Selection");
vSelection.Exec(Procedure("InsertAfter")<<sStr);
Variant vRange=vSelection.OlePropertyGet("Range");
vRange.Exec(Procedure("ConvertToTable")<<wdSeparateByTabs);
Variant vTables=vSelection.OlePropertyGet("Tables");
Variant vTable=vTables.OleFunction("Item",1);
vTable.Exec(Procedure("AutoFormat")<<wdTableFormatProfessional);
[C++ Error] sysvari.h(2561): E2450 Undefined structure 'TAutoArgs<1>'
[C++ Error] sysvari.h(2561): E2449 Size of 'args' is unknown or zero
[C++ Error] sysvari.h(2561): E2450 Undefined structure 'TAutoArgs<1>'
[C++ Error] sysvari.h(2562): E2094 'operator+' not implemented in type
'TAutoArgs<1>' for arguments of type 'int'
[C++ Error] sysvari.h(2563): E2450 Undefined structure 'TAutoArgs<1>'
[C++ Error] sysvari.h(2563): E2285 Could not find a match for
'Variant::OlePropertySet(const AnsiString,undefined)'
[C++ Error] sysvari.h(1842): E2450 Undefined structure 'TAutoArgs<1>'
[C++ Error] sysvari.h(1842): E2449 Size of 'args' is unknown or zero
[C++ Error] sysvari.h(1842): E2450 Undefined structure 'TAutoArgs<1>'
[C++ Error] sysvari.h(1843): E2094 'operator+' not implemented in type
'TAutoArgs<1>' for arguments of type 'int'
[C++ Error] sysvari.h(1844): E2450 Undefined structure 'TAutoArgs<1>'
[C++ Error] sysvari.h(1844): E2285 Could not find a match for
'Variant::OleFunction(const AnsiString,undefined)'