Board index » cppbuilder » .pas to .hpp

.pas to .hpp


2005-03-31 06:24:03 AM
cppbuilder105
I downloaded a set of ADO components off the net yesterday. Now I'm
trying to compile a application that uses them, but the compiler is
giving me this error in the .hpp generated by BCB :
[C++ Error] ADOInt.hpp(578): E2040 Declaration terminated incorrectly.
/* safecall wrapper */ inline Word _scw_Get_EOF() { Word r; HRESULT
hr = Get_EOF(r);
System::CheckSafecallResult(hr); return r; }
#pragma option pop
On this line :
__property Word EOF = {read=_scw_Get_EOF};
^ With the cursor over here.
#pragma option push -w-inl
Please tell me what the error is, and how to fix it.
Thank you.
--
Jonathan
 
 

Re:.pas to .hpp

"Jonathan Benedicto" < XXXX@XXXXX.COM >writes:
Quote
[C++ Error] ADOInt.hpp(578): E2040 Declaration terminated incorrectly.

/* safecall wrapper */ inline Word _scw_Get_EOF() { Word r; HRESULT
hr = Get_EOF(r);
System::CheckSafecallResult(hr); return r; }
#pragma option pop

On this line :
__property Word EOF = {read=_scw_Get_EOF};
^ With the cursor over here.

#pragma option push -w-inl

Please tell me what the error is, and how to fix it.
The error probably is that EOF is a Standard Library macro in C++.
I'm not sure about how to fix that. Can you rename this property to a
name that is not reserved?
 

Re:.pas to .hpp

"Thomas Maeder [TeamB]" < XXXX@XXXXX.COM >wrote in message
Quote
The error probably is that EOF is a Standard Library macro in C++.

I'm not sure about how to fix that. Can you rename this property to
a
name that is not reserved?
Would editing the header in any way affect how the library works ? Or,
could I undef the EOF macro ?
 

{smallsort}

Re:.pas to .hpp

"Jonathan Benedicto" < XXXX@XXXXX.COM >writes:
Quote
>The error probably is that EOF is a Standard Library macro in C++.
>
>I'm not sure about how to fix that. Can you rename this property to
>a name that is not reserved?

Would editing the header in any way affect how the library works?
The generated header? I have no idea, which is why I posted my
suggestion as a question. I am sure somebody reading this does have an
idea, though.
Quote
Or, could I undef the EOF macro ?
Fighting against the language one is using is not a good idea IMHO.
 

Re:.pas to .hpp

"Thomas Maeder [TeamB]" < XXXX@XXXXX.COM >wrote in message
Quote

The generated header? I have no idea, which is why I posted my
suggestion as a question. I am sure somebody reading this does have
an
idea, though.
I changed the EOF to eof, and now the app compiles and runs fine.
Thank you for your help.
Quote
Fighting against the language one is using is not a good idea IMHO.
I'm glad I did not have to do this.
 

Re:.pas to .hpp

"Jonathan Benedicto" < XXXX@XXXXX.COM >writes:
Quote

I changed the EOF to eof, and now the app compiles and runs fine.
Thank you for your help.
That's better but there is an eof function in the standard library.
You can either ignore the fact that you're using the same name that
the library uses, or you can change names. In a small application, it
may be ok to ignore. In the long run, though, usually things come
back to haunt you.
Quote
>Fighting against the language one is using is not a good idea IMHO.

I'm glad I did not have to do this.
Yep. Hijacking names from the standard library is evil. Hiding them
is less so, but still problematic.
--
Chris (TeamB);
 

Re:.pas to .hpp

"Chris Uzdavinis (TeamB)" < XXXX@XXXXX.COM >wrote in message
Quote

That's better but there is an eof function in the standard library.
You can either ignore the fact that you're using the same name that
the library uses, or you can change names. In a small application,
it
may be ok to ignore. In the long run, though, usually things come
back to haunt you.
I think that I'd better change it to EndOfFile or something like that.