PC Review


Reply
Thread Tools Rate Thread

How can I get the running mode ?

 
 
xTroLL
Guest
Posts: n/a
 
      15th Mar 2005
Hi,

I want to get the running mode (DEBUG or RELEASE) of my application ? Somebody can help me ?

xTroLL


--------------= Posted using GrabIt =----------------
------= Binary Usenet downloading made easy =---------
-= Get GrabIt for free from http://www.shemes.com/ =-

 
Reply With Quote
 
 
 
 
=?Utf-8?B?UGVuZyBKaWU=?=
Guest
Posts: n/a
 
      15th Mar 2005
Do you mean pre-compiler directive?

#if (DEBUG)
Log.WriteLine("blah blah blah");
#endif

"xTroLL" wrote:

> Hi,
>
> I want to get the running mode (DEBUG or RELEASE) of my application ? Somebody can help me ?
>
> xTroLL
>
>
> --------------= Posted using GrabIt =----------------
> ------= Binary Usenet downloading made easy =---------
> -= Get GrabIt for free from http://www.shemes.com/ =-
>
>

 
Reply With Quote
 
=?Utf-8?B?eFRyb0xM?=
Guest
Posts: n/a
 
      15th Mar 2005
I'm already trying that. But it's not that I want.

In my application, I want to get the type of the compilation use to put it
on a listview

That means : Data application name - Data application value

exemple:
DEBUG - 1.0.882.19234 or RELEASE - 1.0.882.19234

I want that for an About form

PS : Sorry if my english isn't very good

"Peng Jie" wrote:

> Do you mean pre-compiler directive?
>
> #if (DEBUG)
> Log.WriteLine("blah blah blah");
> #endif
>
> "xTroLL" wrote:
>
> > Hi,
> >
> > I want to get the running mode (DEBUG or RELEASE) of my application ? Somebody can help me ?
> >
> > xTroLL
> >
> >
> > --------------= Posted using GrabIt =----------------
> > ------= Binary Usenet downloading made easy =---------
> > -= Get GrabIt for free from http://www.shemes.com/ =-
> >
> >

 
Reply With Quote
 
=?Utf-8?B?eFRyb0xM?=
Guest
Posts: n/a
 
      15th Mar 2005
Your solution is very good. I don't really understand what you wrote.

Thanks
xTroLL

"xTroLL" wrote:

> I'm already trying that. But it's not that I want.
>
> In my application, I want to get the type of the compilation use to put it
> on a listview
>
> That means : Data application name - Data application value
>
> exemple:
> DEBUG - 1.0.882.19234 or RELEASE - 1.0.882.19234
>
> I want that for an About form
>
> PS : Sorry if my english isn't very good
>
> "Peng Jie" wrote:
>
> > Do you mean pre-compiler directive?
> >
> > #if (DEBUG)
> > Log.WriteLine("blah blah blah");
> > #endif
> >
> > "xTroLL" wrote:
> >
> > > Hi,
> > >
> > > I want to get the running mode (DEBUG or RELEASE) of my application ? Somebody can help me ?
> > >
> > > xTroLL
> > >
> > >
> > > --------------= Posted using GrabIt =----------------
> > > ------= Binary Usenet downloading made easy =---------
> > > -= Get GrabIt for free from http://www.shemes.com/ =-
> > >
> > >

 
Reply With Quote
 
Nathan Neitzke
Guest
Posts: n/a
 
      16th Mar 2005
xTroll,
If you are still looking for an answer, here it is.

A preprocessor directive is performed by the compiler at compile time. The
following snippet works -

#if DEBUG

Console.WriteLine("Debug Version!");

#else

Console.WriteLine("Release Version!");

#endif



It works because DEBUG is set to true when you compile your app in Debug
mode with VS.NET (think of DEBUG as a variable the compiler uses while
compiling the app. You can define your own compile level variables by the
#define keyword. Such as -

#define pi 3.14

All the compiler does is find all the places where the symbol pi is in your
code (not in string literals though) and replaces it with the literal 3.14.



Hence, DEBUG is replaced with the literal true when compiling in debug mode.



Take care.

--

Nathan

"xTroLL" <(E-Mail Removed)> wrote in message
news:A06BD7E5-D1B1-4380-AC22-(E-Mail Removed)...
> Your solution is very good. I don't really understand what you wrote.
>
> Thanks
> xTroLL
>
> "xTroLL" wrote:
>
>> I'm already trying that. But it's not that I want.
>>
>> In my application, I want to get the type of the compilation use to put
>> it
>> on a listview
>>
>> That means : Data application name - Data application value
>>
>> exemple:
>> DEBUG - 1.0.882.19234 or RELEASE - 1.0.882.19234
>>
>> I want that for an About form
>>
>> PS : Sorry if my english isn't very good
>>
>> "Peng Jie" wrote:
>>
>> > Do you mean pre-compiler directive?
>> >
>> > #if (DEBUG)
>> > Log.WriteLine("blah blah blah");
>> > #endif
>> >
>> > "xTroLL" wrote:
>> >
>> > > Hi,
>> > >
>> > > I want to get the running mode (DEBUG or RELEASE) of my application ?
>> > > Somebody can help me ?
>> > >
>> > > xTroLL
>> > >
>> > >
>> > > --------------= Posted using GrabIt =----------------
>> > > ------= Binary Usenet downloading made easy =---------
>> > > -= Get GrabIt for free from http://www.shemes.com/ =-
>> > >
>> > >



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
vb.net running in debug mode vs. running the executable Brad Pears Microsoft VB .NET 3 23rd May 2008 06:25 PM
Switch between Design Mode and "Running" Mode =?Utf-8?B?Y2xhcmE=?= Microsoft Excel Programming 1 19th Mar 2007 11:33 PM
How can I determine if the app is running in Debug mode or Release mode? Henry Padilla Microsoft VB .NET 4 5th May 2005 05:36 PM
Two copies of Outlook running (or at least two windows running) when I launch Outlook 2003 in Cached Exchange Mode... News Reader Microsoft Outlook 0 24th Jun 2004 09:15 PM
Running XP in 98 mode Chuck Windows XP Basics 1 10th Sep 2003 03:13 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:09 PM.