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 

BDS2006: #define-Conflict due to winspool.h

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage)
View previous topic :: View next topic  
Author Message
Udo Weik
Guest





PostPosted: Mon May 14, 2007 11:54 pm    Post subject: BDS2006: #define-Conflict due to winspool.h Reply with quote



Hello,

I'm using a 3rd Party component which has a method "AddForm".
When I use that method, I get the following linker error:
Unresolved external '__fastcall NAMESPACE::COMPONENT::AddFormA( ... *)'
referenced from ... XYZ_UNIT1.OBJ

In winspool.h is a #define which is the reason for that problem:
#ifdef UNICODE
#define AddForm AddFormW
#else
#define AddForm AddFormA
#endif // !UNICODE

Does anybody know a solution (apart from renaming the method...)?


Thanks and greetings
Udo
Back to top
Craig Farrell
Guest





PostPosted: Tue May 15, 2007 12:37 am    Post subject: Re: BDS2006: #define-Conflict due to winspool.h Reply with quote



Hi,

Quote:

In winspool.h is a #define which is the reason for that problem:
#ifdef UNICODE
#define AddForm AddFormW
#else
#define AddForm AddFormA
#endif // !UNICODE

Does an undef help,e.g.
#include <winspool.h?
#undef AddForm

Or does that just move the problem somewhere else?

--Craig
Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Tue May 15, 2007 3:30 am    Post subject: Re: BDS2006: #define-Conflict due to winspool.h Reply with quote



"Udo Weik" <WeikEngOff (AT) aol (DOT) com> wrote in message
news:4648b013 (AT) newsgroups (DOT) borland.com...

Quote:
In winspool.h is a #define which is the reason for that problem:

Winspool has other defines that interfer with various VCL methods
(such as SetPort()). This is documented on Borland's website (go to
http://search.borland.com). Microsoft's whole approach to using
macros for function overloading causes all kinds of havoc on the VCL.


Gambit
Back to top
Udo Weik
Guest





PostPosted: Tue May 15, 2007 11:37 pm    Post subject: Re: BDS2006: #define-Conflict due to winspool.h Reply with quote

Hello Craig,

Quote:
Does an undef help,e.g.
#include <winspool.h?
#undef AddForm

yep, works, inserted in the *.cpp-file:

include <vcl.h>
#pragma hdrstop

#include <winspool.h>
#undef AddForm

#include "XYZ_UNIT1.h"


Many thanks you both.
Udo
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage) 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.