Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Custom Build Configuration MFC

Custom Build Configuration MFC

Scheduled Pinned Locked Moved C / C++ / MFC
csharpc++visual-studiocomdebugging
5 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Monark
    wrote on last edited by
    #1

    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

    P N P K 4 Replies Last reply
    0
    • M Monark

      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

      N Offline
      N Offline
      Naveen
      wrote on last edited by
      #2

      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]

      1 Reply Last reply
      0
      • M Monark

        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

        P Offline
        P Offline
        prasad_som
        wrote on last edited by
        #3

        You can have configuration specific macros defined in project settings. And based on that, compile code conditinally, using #ifdef.


        Prasad MS MVP -  VC++

        1 Reply Last reply
        0
        • M Monark

          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

          P Offline
          P Offline
          Paresh Chitte
          wrote on last edited by
          #4

          #ifdef _DEBUG debugMethod(); debug1Method(); #else if _RELEASE releaseMethod(); #else AdvanceReleaeMethod(); #endif Regards, Paresh.

          1 Reply Last reply
          0
          • M Monark

            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

            K Offline
            K Offline
            Karismatic
            wrote on last edited by
            #5

            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"

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups