M
Mark Johnson
Also, what are the pre-processor symbols I should use for checking for
I have not found a standard way of doining this.
There is no pre-processor symbols like DEBUG for this.
I use to the following work around:
(I am using a German Version, so I am not sure of the English expressions -
would like to have them BTW for Documentation)
Set the following in Framework.Compact Projects :
\Project\Properties\
Configuration : all configurations
\Configuration Properties\Set pre-processor for Compiling : COMPACT
The following works correctly :
#if (DEBUG && !COMPACT)
#warning Net.Framework (Debug) is defined
#elif (!DEBUG && !COMPACT)
#warning Net.Framework (Release) is defined
#elif (DEBUG && COMPACT)
#warning Net.Framework.Compact (Debug) is defined
#else
#warning Net.Framework.Compact (Release) is defined
#endif
a Sample of code that will run on both Mashines :
#if COMPACT
pn_Panel.Capture = true;
IntPtr hWnd = Win32Window.GetCapture();
pn_Panel.Capture = false;
p_IntPtr = OpenNETCF.WinAPI.Core.GetDC(hWnd);
#else
p_IntPtr = p_Graphics.GetHdc();
p_Graphics.ReleaseHdc(p_IntPtr);
#endif
When shown in VS, the "inactive code" will be grey to show that it will not
be compiled.
Hope this helps
Mark Johnson, Berlin Germany
(e-mail address removed)
I have not found a standard way of doining this.
There is no pre-processor symbols like DEBUG for this.
I use to the following work around:
(I am using a German Version, so I am not sure of the English expressions -
would like to have them BTW for Documentation)
Set the following in Framework.Compact Projects :
\Project\Properties\
Configuration : all configurations
\Configuration Properties\Set pre-processor for Compiling : COMPACT
The following works correctly :
#if (DEBUG && !COMPACT)
#warning Net.Framework (Debug) is defined
#elif (!DEBUG && !COMPACT)
#warning Net.Framework (Release) is defined
#elif (DEBUG && COMPACT)
#warning Net.Framework.Compact (Debug) is defined
#else
#warning Net.Framework.Compact (Release) is defined
#endif
a Sample of code that will run on both Mashines :
#if COMPACT
pn_Panel.Capture = true;
IntPtr hWnd = Win32Window.GetCapture();
pn_Panel.Capture = false;
p_IntPtr = OpenNETCF.WinAPI.Core.GetDC(hWnd);
#else
p_IntPtr = p_Graphics.GetHdc();
p_Graphics.ReleaseHdc(p_IntPtr);
#endif
When shown in VS, the "inactive code" will be grey to show that it will not
be compiled.
Hope this helps
Mark Johnson, Berlin Germany
(e-mail address removed)