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. some interview questions

some interview questions

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++career
21 Posts 7 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.
  • C Cedric Moonen

    For me, the first method to be called is the main function :rolleyes:. That's why it's important to see what they mean by 'first': first function (at all), first app function (with or without constructor included), ... So, it is very vague

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

    Cedric Moonen wrote:

    For me, the first method to be called is the main function

    One doubt? In a MFC Dialog based application there is global varaible of app class.. So before calling the main funtion surely its constructor is called..isn't it? nave

    T C 2 Replies Last reply
    0
    • N Naveen

      Cedric Moonen wrote:

      For me, the first method to be called is the main function

      One doubt? In a MFC Dialog based application there is global varaible of app class.. So before calling the main funtion surely its constructor is called..isn't it? nave

      T Offline
      T Offline
      toxcct
      wrote on last edited by
      #9

      actually, in MFC, you don't excplicity write the main function, but it exists, within the framework.


      TOXCCT >>> GEII power

      [VisualCalc 3.0  updated ][Flags Beginner's Guide  new! ]

      N 1 Reply Last reply
      0
      • T toxcct

        actually, in MFC, you don't excplicity write the main function, but it exists, within the framework.


        TOXCCT >>> GEII power

        [VisualCalc 3.0  updated ][Flags Beginner's Guide  new! ]

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

        toxcct wrote:

        but it exists, within the framework.

        I agree with that one.. But "Cedric Moonen " say the first function called is main. Before calling the main the constructor of the app class is called isn't it? nave

        T 1 Reply Last reply
        0
        • N Naveen

          toxcct wrote:

          but it exists, within the framework.

          I agree with that one.. But "Cedric Moonen " say the first function called is main. Before calling the main the constructor of the app class is called isn't it? nave

          T Offline
          T Offline
          toxcct
          wrote on last edited by
          #11

          i don't think so... the constructor of the app is called after main() started... unless the application is a global object :-D


          TOXCCT >>> GEII power

          [VisualCalc 3.0  updated ][Flags Beginner's Guide  new! ] -- modified at 8:07 Thursday 11th May, 2006

          C N 2 Replies Last reply
          0
          • T toxcct

            i don't think so... the constructor of the app is called after main() started... unless the application is a global object :-D


            TOXCCT >>> GEII power

            [VisualCalc 3.0  updated ][Flags Beginner's Guide  new! ] -- modified at 8:07 Thursday 11th May, 2006

            C Offline
            C Offline
            Cedric Moonen
            wrote on last edited by
            #12

            Nope, not if the App class is global. Then, first the instance of the class will be created (resulting in calling the constructor). -- modified at 7:58 Thursday 11th May, 2006

            T 1 Reply Last reply
            0
            • T toxcct

              i don't think so... the constructor of the app is called after main() started... unless the application is a global object :-D


              TOXCCT >>> GEII power

              [VisualCalc 3.0  updated ][Flags Beginner's Guide  new! ] -- modified at 8:07 Thursday 11th May, 2006

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

              How's that possible..:^) Global variables are initialize first then only main function is called... Try creating a simple console application.. with a global variable.. nave

              T 1 Reply Last reply
              0
              • N Naveen

                Cedric Moonen wrote:

                For me, the first method to be called is the main function

                One doubt? In a MFC Dialog based application there is global varaible of app class.. So before calling the main funtion surely its constructor is called..isn't it? nave

                C Offline
                C Offline
                Cedric Moonen
                wrote on last edited by
                #14

                Naveen R wrote:

                In a MFC Dialog based application there is global varaible of app class.. So before calling the main funtion surely its constructor is called..isn't it?

                Yes, constructor will be called first, you are right. I didn't remember that the application was global. When I write a console app with a kind of app object, I aleays declare it inside the main function, that's why I didn't think of that ;)

                1 Reply Last reply
                0
                • C Cedric Moonen

                  Nope, not if the App class is global. Then, first the instance of the class will be created (resulting in calling the constructor). -- modified at 7:58 Thursday 11th May, 2006

                  T Offline
                  T Offline
                  toxcct
                  wrote on last edited by
                  #15

                  you're right :doh:


                  TOXCCT >>> GEII power

                  [VisualCalc 3.0  updated ][Flags Beginner's Guide  new! ]

                  1 Reply Last reply
                  0
                  • N Naveen

                    How's that possible..:^) Global variables are initialize first then only main function is called... Try creating a simple console application.. with a global variable.. nave

                    T Offline
                    T Offline
                    toxcct
                    wrote on last edited by
                    #16

                    yes i forgot that point... ;)


                    TOXCCT >>> GEII power

                    [VisualCalc 3.0  updated ][Flags Beginner's Guide  new! ]

                    1 Reply Last reply
                    0
                    • K kumar_mk

                      please try to answer one or more or all of some of the questions being asked in an interview: 1.)How is the message being transformed from one class to other? Diagrammatically show which class is getting the message first. 2.)What is Message Reflection? 3.)can we change modal to modeless? 4.)what would be the first function called if we create a mfc application if it is a dialog based and not a dialog based? 5.)first function to be called in the dialog based application? thaking you kumar

                      N Offline
                      N Offline
                      NiceNaidu fo
                      wrote on last edited by
                      #17

                      1.)How is the message being transformed from one class to other? Diagrammatically show which class is getting the message first. Ans In MFC ,CCmdTarget is the class responsible for message routing 4.)what would be the first function called if we create a mfc application if it is a dialog based and not a dialog based? Ans What ever may be the application type the first method to be called is Constructor followed by InitInstace.Inorder to understand what happens inside have a look over this article http://www.codeproject.com/cpp/mfcprogflow.asp[^] AppU

                      N 1 Reply Last reply
                      0
                      • N NiceNaidu fo

                        1.)How is the message being transformed from one class to other? Diagrammatically show which class is getting the message first. Ans In MFC ,CCmdTarget is the class responsible for message routing 4.)what would be the first function called if we create a mfc application if it is a dialog based and not a dialog based? Ans What ever may be the application type the first method to be called is Constructor followed by InitInstace.Inorder to understand what happens inside have a look over this article http://www.codeproject.com/cpp/mfcprogflow.asp[^] AppU

                        N Offline
                        N Offline
                        NiceNaidu fo
                        wrote on last edited by
                        #18

                        Q) What is message refelection Ans This must give you an Idea http://msdn2.microsoft.com/en-US/library/eeah46xd.aspx[^]

                        1 Reply Last reply
                        0
                        • N Naveen

                          kiran janaswamy wrote:

                          OnInitDialog(...)

                          How can u say that OnInitDialog is the first function that is been called in a dialog based application? I think it is the constructor of the app class that is been called first...:-D Even if ur saying about a Dialog class there are so many other functions that gets called before OnInitDialog..say PreSubClassWindow(), etc including the constructor of the dialog class;) nave

                          T Offline
                          T Offline
                          ThatsAlok
                          wrote on last edited by
                          #19

                          Naveen R wrote:

                          I think it is the constructor of the app class that is been called first...:-D

                          What About CWinApp or CDialog Derived Class Constructor :)

                          "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

                          cheers, Alok Gupta VC Forum Q&A :- I/ IV

                          N 1 Reply Last reply
                          0
                          • T ThatsAlok

                            Naveen R wrote:

                            I think it is the constructor of the app class that is been called first...:-D

                            What About CWinApp or CDialog Derived Class Constructor :)

                            "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

                            cheers, Alok Gupta VC Forum Q&A :- I/ IV

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

                            ya I mean the same,:| not CWinApp constrcutor nave

                            T 1 Reply Last reply
                            0
                            • N Naveen

                              ya I mean the same,:| not CWinApp constrcutor nave

                              T Offline
                              T Offline
                              ThatsAlok
                              wrote on last edited by
                              #21

                              Naveen R wrote:

                              ya I mean the same,:| not CWinApp constrcutor

                              i am jokin buddy!

                              "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

                              cheers, Alok Gupta VC Forum Q&A :- I/ IV

                              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