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 continued

Callback continued

Scheduled Pinned Locked Moved C / C++ / MFC
c++data-structures
2 Posts 2 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
    S van Leent
    wrote on last edited by
    #1

    As I've read in my previous post "Callback and Assembly", there are more then one way to get it done. It's about a Callback procedure in a class. The following methods I came accross: Static with a pointer to the class to call the non-static member Thunking, as is done in ATL with use of assembly Convert thiscall to a callback, but it's highly inportable. Attaching a class and a HWND into a Dynamic Array, and use a global Callback that calls the right class (use virtual member functions) I'm curious, how many more great ways are there to do an OO-callback LPCTSTR Dutch = TEXT("Double Dutch :-)");

    D 1 Reply Last reply
    0
    • S S van Leent

      As I've read in my previous post "Callback and Assembly", there are more then one way to get it done. It's about a Callback procedure in a class. The following methods I came accross: Static with a pointer to the class to call the non-static member Thunking, as is done in ATL with use of assembly Convert thiscall to a callback, but it's highly inportable. Attaching a class and a HWND into a Dynamic Array, and use a global Callback that calls the right class (use virtual member functions) I'm curious, how many more great ways are there to do an OO-callback LPCTSTR Dutch = TEXT("Double Dutch :-)");

      D Offline
      D Offline
      Daniel Lohmann
      wrote on last edited by
      #2

      Thunking/converting thiscall to callback without using fancy assembler tricks, but adapter objects and C++ standard language features as described in my article Use member functions for C-style callbacks and threads - a general solution. The article focusses on dealing with the typical Win32 API callbacks, however, the underlaying technique is generic and portable. -- Daniel Lohmann http://www.losoft.de (Hey, this page is worth looking! You can find some free and handy NT tools there :-D )

      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