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. CALLBACK

CALLBACK

Scheduled Pinned Locked Moved C / C++ / MFC
question
14 Posts 5 Posters 2 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 Shi Zhu

    hello,Please tell me what CALLBACK doing?thanks. human

    L Offline
    L Offline
    l a u r e n
    wrote on last edited by
    #2

    callback functions are static functions in your code that the operating system calls to notify you of some condition, such as a timer firing


    "there is no spoon"
    biz stuff   about me

    P S 2 Replies Last reply
    0
    • L l a u r e n

      callback functions are static functions in your code that the operating system calls to notify you of some condition, such as a timer firing


      "there is no spoon"
      biz stuff   about me

      P Offline
      P Offline
      Prakash Nadar
      wrote on last edited by
      #3

      l a u r e n wrote: callback functions are static functions in your code callback functions are not static functions... It is defined as follows

      #define CALLBACK __stdcall


      MSN Messenger. prakashnadar@msn.com

      R 1 Reply Last reply
      0
      • P Prakash Nadar

        l a u r e n wrote: callback functions are static functions in your code callback functions are not static functions... It is defined as follows

        #define CALLBACK __stdcall


        MSN Messenger. prakashnadar@msn.com

        R Offline
        R Offline
        Rickard Andersson20
        wrote on last edited by
        #4

        Think twice, what about in C++? Rickard Andersson Here is my card, contact me later! UIN: 50302279 Sonork: 37318

        P 2 Replies Last reply
        0
        • L l a u r e n

          callback functions are static functions in your code that the operating system calls to notify you of some condition, such as a timer firing


          "there is no spoon"
          biz stuff   about me

          S Offline
          S Offline
          Shi Zhu
          wrote on last edited by
          #5

          thanks,Would you give me CALLBACK example. human

          1 Reply Last reply
          0
          • R Rickard Andersson20

            Think twice, what about in C++? Rickard Andersson Here is my card, contact me later! UIN: 50302279 Sonork: 37318

            P Offline
            P Offline
            Prakash Nadar
            wrote on last edited by
            #6

            Well i did do some RnD before posting tht , as long as it is VC++ i dont think its a static function unless i missed something. or you could show me something that says its static.


            MSN Messenger. prakashnadar@msn.com

            1 Reply Last reply
            0
            • R Rickard Andersson20

              Think twice, what about in C++? Rickard Andersson Here is my card, contact me later! UIN: 50302279 Sonork: 37318

              P Offline
              P Offline
              Prakash Nadar
              wrote on last edited by
              #7

              Rickard Andersson19 wrote: Think twice surely in VC++ CALLBACK is not a static function at all. and Rickard Andersson19 wrote: what about in C++? Is VC++ not C++ ?? so really i dont know which C++ compiler you are talking about, but in VC++ callback is not a static function, its only a calling convention.


              MSN Messenger. prakashnadar@msn.com

              R 1 Reply Last reply
              0
              • P Prakash Nadar

                Rickard Andersson19 wrote: Think twice surely in VC++ CALLBACK is not a static function at all. and Rickard Andersson19 wrote: what about in C++? Is VC++ not C++ ?? so really i dont know which C++ compiler you are talking about, but in VC++ callback is not a static function, its only a calling convention.


                MSN Messenger. prakashnadar@msn.com

                R Offline
                R Offline
                Rickard Andersson20
                wrote on last edited by
                #8

                Mr.Prakash wrote: Is VC++ not C++ ?? :sigh: VC++ is a compiler. C++ is a language. In C++ (the language) you must declare a method as static before you can use as a callback. Rickard Andersson Here is my card, contact me later! UIN: 50302279 Sonork: 37318

                P 1 Reply Last reply
                0
                • S Shi Zhu

                  hello,Please tell me what CALLBACK doing?thanks. human

                  G Offline
                  G Offline
                  Gary R Wheeler
                  wrote on last edited by
                  #9

                  A CALLBACK function is a function in your code that Windows calls to tell you about an event or an item of interest. Here is an example. The Windows API function EnumWindows enumerates the top-level windows. You pass it a pointer to a CALLBACK function. Windows calls that function once for each top-level window:

                  BOOL CALLBACK MyFunction(HWND hwnd,LPARAM lParam)
                  {
                  //...
                  return TRUE;
                  }

                  // somewhere else in your code:

                  EnumWindows(MyFunction,0);
                  

                  The function MyFunction is a callback function. When you call EnumWindows, Windows will call MyFunction for each top-level window in the system.


                  Software Zen: delete this;

                  S 1 Reply Last reply
                  0
                  • R Rickard Andersson20

                    Mr.Prakash wrote: Is VC++ not C++ ?? :sigh: VC++ is a compiler. C++ is a language. In C++ (the language) you must declare a method as static before you can use as a callback. Rickard Andersson Here is my card, contact me later! UIN: 50302279 Sonork: 37318

                    P Offline
                    P Offline
                    Prakash Nadar
                    wrote on last edited by
                    #10

                    Rickard Andersson19 wrote: VC++ is a compiler. C++ is a language. VC++ compiles code writen in C++ so If you write something in C++ that VC++ cannot compile then its not a VC++ code. what ever that meant. using static functions as callback is one thing and in VC++ CALLBACK is different not callback but CALLBACK (something the original poster has asked the question about). I hope now its clear.


                    MSN Messenger. prakashnadar@msn.com

                    R 1 Reply Last reply
                    0
                    • P Prakash Nadar

                      Rickard Andersson19 wrote: VC++ is a compiler. C++ is a language. VC++ compiles code writen in C++ so If you write something in C++ that VC++ cannot compile then its not a VC++ code. what ever that meant. using static functions as callback is one thing and in VC++ CALLBACK is different not callback but CALLBACK (something the original poster has asked the question about). I hope now its clear.


                      MSN Messenger. prakashnadar@msn.com

                      R Offline
                      R Offline
                      Rickard Andersson20
                      wrote on last edited by
                      #11

                      Mr.Prakash wrote: VC++ compiles code writen in C++ so If you write something in C++ that VC++ cannot compile then its not a VC++ code. what ever that meant. You can write C code. And LRESULT CALLBACK Name(...) is a callback declaration of a C function callback, not C++. lauren said it's a static function, and because this is a (V)C++ forum C++ is the first hand language so a callback function is a static function (member function actually). Mr.Prakash wrote: and in VC++ CALLBACK is different not callback but CALLBACK (something the original poster has asked the question about). I hope now its clear. if so, lauren explained what a callback was? not the defination of CALLBACK... Rickard Andersson Here is my card, contact me later! UIN: 50302279 Sonork: 37318

                      P 1 Reply Last reply
                      0
                      • R Rickard Andersson20

                        Mr.Prakash wrote: VC++ compiles code writen in C++ so If you write something in C++ that VC++ cannot compile then its not a VC++ code. what ever that meant. You can write C code. And LRESULT CALLBACK Name(...) is a callback declaration of a C function callback, not C++. lauren said it's a static function, and because this is a (V)C++ forum C++ is the first hand language so a callback function is a static function (member function actually). Mr.Prakash wrote: and in VC++ CALLBACK is different not callback but CALLBACK (something the original poster has asked the question about). I hope now its clear. if so, lauren explained what a callback was? not the defination of CALLBACK... Rickard Andersson Here is my card, contact me later! UIN: 50302279 Sonork: 37318

                        P Offline
                        P Offline
                        Prakash Nadar
                        wrote on last edited by
                        #12

                        Rickard Andersson19 wrote: if so, lauren explained what a callback was? not the defination of CALLBACK... lauren said its a static function, which is wrong(it can be a static function but not neccessary). lauren said what is callback function, that is correct. no wonder the author of the post had given a low grade to that ans.


                        MSN Messenger. prakashnadar@msn.com

                        R 1 Reply Last reply
                        0
                        • P Prakash Nadar

                          Rickard Andersson19 wrote: if so, lauren explained what a callback was? not the defination of CALLBACK... lauren said its a static function, which is wrong(it can be a static function but not neccessary). lauren said what is callback function, that is correct. no wonder the author of the post had given a low grade to that ans.


                          MSN Messenger. prakashnadar@msn.com

                          R Offline
                          R Offline
                          Rickard Andersson20
                          wrote on last edited by
                          #13

                          Mr.Prakash wrote: lauren said its a static function, which is wrong In C++ it's not. Mr.Prakash wrote: lauren said what is callback function, that is correct. What do you mean? Your English is almost impossible to understand sometimes. Rickard Andersson Here is my card, contact me later! UIN: 50302279 Sonork: 37318

                          1 Reply Last reply
                          0
                          • G Gary R Wheeler

                            A CALLBACK function is a function in your code that Windows calls to tell you about an event or an item of interest. Here is an example. The Windows API function EnumWindows enumerates the top-level windows. You pass it a pointer to a CALLBACK function. Windows calls that function once for each top-level window:

                            BOOL CALLBACK MyFunction(HWND hwnd,LPARAM lParam)
                            {
                            //...
                            return TRUE;
                            }

                            // somewhere else in your code:

                            EnumWindows(MyFunction,0);
                            

                            The function MyFunction is a callback function. When you call EnumWindows, Windows will call MyFunction for each top-level window in the system.


                            Software Zen: delete this;

                            S Offline
                            S Offline
                            Shi Zhu
                            wrote on last edited by
                            #14

                            thanks Gary R. Wheeler human

                            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