Custom Build Configuration MFC
-
Hi All, I am developing a MFC ActiveX Control in Visual Studio 2005. I want to compile some methods in debug1 and some in release. class MyClass { debugMethod(); debug1Method(); releaseMethod() AdvanceReleaeMethod(); } Now I want that when active configuration is "Debug" only debugMethod should compile and when active configuration is "Advance Releae" only "AdvanceReleaeMethod" method should compile. Any Help? Thanks in advance. Micky Micky
-
Hi All, I am developing a MFC ActiveX Control in Visual Studio 2005. I want to compile some methods in debug1 and some in release. class MyClass { debugMethod(); debug1Method(); releaseMethod() AdvanceReleaeMethod(); } Now I want that when active configuration is "Debug" only debugMethod should compile and when active configuration is "Advance Releae" only "AdvanceReleaeMethod" method should compile. Any Help? Thanks in advance. Micky Micky
put a preprocessor checking like class MyClass { #ifdef _DEBUG debugMethod(); debug1Method(); #else if _RELEASEMODE releaseMethod() #else AdvanceReleaeMethod(); #end if } and now in the Release mode settings define _RELEASEMODE
nave [OpenedFileFinder]
-
Hi All, I am developing a MFC ActiveX Control in Visual Studio 2005. I want to compile some methods in debug1 and some in release. class MyClass { debugMethod(); debug1Method(); releaseMethod() AdvanceReleaeMethod(); } Now I want that when active configuration is "Debug" only debugMethod should compile and when active configuration is "Advance Releae" only "AdvanceReleaeMethod" method should compile. Any Help? Thanks in advance. Micky Micky
You can have configuration specific macros defined in project settings. And based on that, compile code conditinally, using
#ifdef
.
Prasad MS MVP - VC++
-
Hi All, I am developing a MFC ActiveX Control in Visual Studio 2005. I want to compile some methods in debug1 and some in release. class MyClass { debugMethod(); debug1Method(); releaseMethod() AdvanceReleaeMethod(); } Now I want that when active configuration is "Debug" only debugMethod should compile and when active configuration is "Advance Releae" only "AdvanceReleaeMethod" method should compile. Any Help? Thanks in advance. Micky Micky
#ifdef _DEBUG debugMethod(); debug1Method(); #else if _RELEASE releaseMethod(); #else AdvanceReleaeMethod(); #endif Regards, Paresh.
-
Hi All, I am developing a MFC ActiveX Control in Visual Studio 2005. I want to compile some methods in debug1 and some in release. class MyClass { debugMethod(); debug1Method(); releaseMethod() AdvanceReleaeMethod(); } Now I want that when active configuration is "Debug" only debugMethod should compile and when active configuration is "Advance Releae" only "AdvanceReleaeMethod" method should compile. Any Help? Thanks in advance. Micky Micky
For doing this you need to know the concept of preprocessor directive #IFDEF | #IFNDEF ConstantName Commands [#ELSE Commands] #ENDIF if you know this you can do it by just defining a macro suppose _DEBUG_MODE and put it in preprocessor defination of C++ in project properties under debug configuration. and then define like this class MyClass { #ifdef _DEBUG_MODE debugMethod(); debug1Method(); #ELSE releaseMethod() #ENDIF }
Regards, Pankaj Sachdeva "There is no future lies in any job" "but" "future lies in the person who holds the job"