Code Guard Illegaly casted object


2005-02-01 04:07:06 PM
cppbuilder106
Hi,
When I run the following code snippet in C++BuliderV6 , Code guard gaves
"Method called on illegaly casted object " error, in file classes.h on
the line
/* TFiler.Create */ inline __fastcall TWriter(TStream* Stream, int
BufSize) : TFiler(Stream, BufSize) { }
Am I doing something wrong ?
I am using C++Builder 6. I've install ServicePack #4.I'm not sure if
it is installed or not. Is it a way to check it ?
Thanks,
Sabetay
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "classes.hpp"
#include <memory>
//---------------------------------------------------------------------------
#pragma argsused
int main(int argc, char* argv[])
{
std::auto_ptr<TFileStream>Fs( new TFileStream("Test",
fmOpenWrite | fmCreate));
TWriter *Writer = new TWriter(Fs.get(),1024); // Code guard
gave the errror
Writer->WriteListBegin(),
Writer->WriteListEnd();
return 0;
}
//---------------------------------------------------------------------------