Board index » cppbuilder » Compile error of sysvari.h

Compile error of sysvari.h

On Mon, 10 Jul 2000 08:00:41 +0800, "Tzong-Tsann Hung"

Quote
<rdcen...@ms25.hinet.net> wrote:
>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?

If you are using BCB 4 then this is a known problem. The fix is to add

#include <utilcls.h>

which has the necessary declarations to satisfy the compiler.

--
Brought to you by Erols Internet, an RCN/Starpower company:
"Where service is cheap and performance is poor."

 

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)
{

Quote
}

//--------------------------------------------------------------------------
-
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();

Quote
}

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

Quote
}

[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)'

Re:Compile error of sysvari.h


Hello,

Quote
> reference book, but there were errors and the errors are all about
> sysvari.h, I did not change anything in this file. why?

Those kinds of errors can be due to order-of-inclusion of headers.
Try include vcl.h before you include utilcls.h.

--Craig

Re:Compile error of sysvari.h


Hi Craig,

   Thanks you , it reall work. Are there  very much trap like this while
learning BCB ?
And does such error mentioned on BCB user guide ?
   Do you know that this problem almost make me to give up learning BCB for
advanced subject ?

Craig Farrell ???g??31 <396A727F.2B53D...@insprise.com>...

Quote
>Hello,

>> reference book, but there were errors and the errors are all about
>> sysvari.h, I did not change anything in this file. why?

>Those kinds of errors can be due to order-of-inclusion of headers.
>Try include vcl.h before you include utilcls.h.

>--Craig

Re:Compile error of sysvari.h


Hello,

Quote
>    Thanks you , it reall work. Are there  very much trap like this while
> learning BCB ?

I know it's not a helpful error. Sometimes I think template
instantiations
obfuscate these things a bit more. THe only other tip (I forgot to
mention)
is that if you turn on Project | Options | COmpiler | Extended Error
information
then you will see things like "instantiating..." such-and-such in the
Message
window. Then you can work backwards from an error like the one you saw.

--Craig

Other Threads