Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / June 2004

Tip: Looking for answers? Try searching our database.

Checking active solution configuration at compile time

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Michael - 27 Jun 2004 20:26 GMT
Hi!
Is it possible to check the active solution configuration (debug, release or some user defined) at compile time using for example preprocessor directives?

Best regards,
Michael
William DePalo [MVP VC++] - 27 Jun 2004 21:27 GMT
> Is it possible to check the active solution configuration
> (debug, release or some user defined) at compile time
> using for example preprocessor directives?

While it is not exactly what you asked, do you know that an easy thing to do
is to check for the presence of debug options is to use something like

   #ifdef DEBUG
   // ...
   #endif

You might want to look at the "Command Line" options under the C++ section
of your project's properties. The options that start with /D are the ones
which set preprocessor symbols.

I would guess that the automation/macro support in the compiler would allow
you to get the information you seek but to be honest that's just a guess as
I have never set out to look for it.

Regards,
Will
Michael - 28 Jun 2004 10:56 GMT
Well, I've already thought of this solution. I've seen something like

IF CONFIG = "Debug"

END IF

posted in other newsgroups but it seems like it only works with VB. I guess I'll have to use the proposed solution.

Regards,
Michael

> > Is it possible to check the active solution configuration
> > (debug, release or some user defined) at compile time
[quoted text clipped - 17 lines]
> Regards,
> Will
Steve McLellan - 28 Jun 2004 11:11 GMT
It's as good a solution as any. Stick a Preprocessor Define (in the Project
configs) for each of your configs. I think DEBUG is automaticaly defined for
Debug builds, and it's easy to add some more for other configurations.

Steve

> Well, I've already thought of this solution. I've seen something like
>
[quoted text clipped - 28 lines]
> > Regards,
> > Will

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.