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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. can we call dynamic_cast in OnInitDialog

can we call dynamic_cast in OnInitDialog

Scheduled Pinned Locked Moved C / C++ / MFC
6 Posts 3 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.
  • S Offline
    S Offline
    SPGV
    wrote on last edited by
    #1

    can we call dynamic_cast in OnInitDialog

    N T 2 Replies Last reply
    0
    • S SPGV

      can we call dynamic_cast in OnInitDialog

      N Offline
      N Offline
      Nish Nishant
      wrote on last edited by
      #2

      SPGV wrote: can we call dynamic_cast in OnInitDialog dynamic_cast is a C++ cast operator. You may use it anywhere in your C++ program [It has nothing to do with MFC or CDialog] Read my article [URL below] for more info on C++ cast operators. http://www.codeproject.com/managedcpp/castingbasics.asp Regards, Nish


      Author of the romantic comedy Summer Love and Some more Cricket [New Win] Review by Shog9 Click here for review[NW]

      1 Reply Last reply
      0
      • S SPGV

        can we call dynamic_cast in OnInitDialog

        T Offline
        T Offline
        Tomasz Sowinski
        wrote on last edited by
        #3

        Yes, assuming that RTTI is enabled in project settings (it's not by default in VC6). What kind of problems are you experiencing? Tomasz Sowinski -- http://www.shooltz.com

        Free your mind and your ass will follow.

        N 2 Replies Last reply
        0
        • T Tomasz Sowinski

          Yes, assuming that RTTI is enabled in project settings (it's not by default in VC6). What kind of problems are you experiencing? Tomasz Sowinski -- http://www.shooltz.com

          Free your mind and your ass will follow.

          N Offline
          N Offline
          Nish Nishant
          wrote on last edited by
          #4

          Tomasz Sowinski wrote: it's not by default in VC6 Woah! I didn't know that! Well, when I was still using VC++ 6 I used C-style casts :-O That explains it I guess :~


          Author of the romantic comedy Summer Love and Some more Cricket [New Win] Review by Shog9 Click here for review[NW]

          1 Reply Last reply
          0
          • T Tomasz Sowinski

            Yes, assuming that RTTI is enabled in project settings (it's not by default in VC6). What kind of problems are you experiencing? Tomasz Sowinski -- http://www.shooltz.com

            Free your mind and your ass will follow.

            N Offline
            N Offline
            Nish Nishant
            wrote on last edited by
            #5

            Tomasz Sowinski wrote: it's not by default in VC6 Guess what! It's not by default in VC7 too. Default compiler option is /GR- for MFC projects. My mistake was that I've done all my recent casting stuff on MC++ projects which have /GR and not /GR- :~ Nish


            Author of the romantic comedy Summer Love and Some more Cricket [New Win] Review by Shog9 Click here for review[NW]

            T 1 Reply Last reply
            0
            • N Nish Nishant

              Tomasz Sowinski wrote: it's not by default in VC6 Guess what! It's not by default in VC7 too. Default compiler option is /GR- for MFC projects. My mistake was that I've done all my recent casting stuff on MC++ projects which have /GR and not /GR- :~ Nish


              Author of the romantic comedy Summer Love and Some more Cricket [New Win] Review by Shog9 Click here for review[NW]

              T Offline
              T Offline
              Tomasz Sowinski
              wrote on last edited by
              #6

              Nishant S wrote: Guess what! It's not by default in VC7 too. I like that. If you want to use dynamic_cast and typeid, you'll better find some good reason and know what you're doing :) Tomasz Sowinski -- http://www.shooltz.com

              Free your mind and your ass will follow.

              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