BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

.pas to .hpp

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Language C++)
View previous topic :: View next topic  
Author Message
Jonathan Benedicto
Guest





PostPosted: Wed Mar 30, 2005 10:24 pm    Post subject: .pas to .hpp Reply with quote



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



Back to top
Thomas Maeder [TeamB]
Guest





PostPosted: Thu Mar 31, 2005 4:13 pm    Post subject: Re: .pas to .hpp Reply with quote



"Jonathan Benedicto" <incorrect (AT) no (DOT) server> 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?

Back to top
Jonathan Benedicto
Guest





PostPosted: Thu Mar 31, 2005 5:56 pm    Post subject: Re: .pas to .hpp Reply with quote



"Thomas Maeder [TeamB]" <maeder (AT) glue (DOT) ch> wrote


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 ?



Back to top
Thomas Maeder [TeamB]
Guest





PostPosted: Thu Mar 31, 2005 8:47 pm    Post subject: Re: .pas to .hpp Reply with quote

"Jonathan Benedicto" <incorrect (AT) no (DOT) server> 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.

Back to top
Jonathan Benedicto
Guest





PostPosted: Thu Mar 31, 2005 8:48 pm    Post subject: Re: .pas to .hpp Reply with quote

"Thomas Maeder [TeamB]" <maeder (AT) glue (DOT) ch> wrote

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.



Back to top
Chris Uzdavinis (TeamB)
Guest





PostPosted: Thu Mar 31, 2005 11:26 pm    Post subject: Re: .pas to .hpp Reply with quote

"Jonathan Benedicto" <incorrect (AT) no (DOT) server> 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);

Back to top
Jonathan Benedicto
Guest





PostPosted: Thu Mar 31, 2005 11:31 pm    Post subject: Re: .pas to .hpp Reply with quote

"Chris Uzdavinis (TeamB)" <chris (AT) uzdavinis (DOT) com> wrote

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.



Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Language C++) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.