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. Progress updates from callback function

Progress updates from callback function

Scheduled Pinned Locked Moved C / C++ / MFC
questionannouncement
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.
  • J Offline
    J Offline
    Jake Palmer
    wrote on last edited by
    #1

    Here's something that's puzzling me: the purpose of the callback function for AVISave is to update a Progress control with the percent done. But the callback function must be global or static, and only takes an int nPercent argument, so how can I access any Progress control or dialog member variables from this callback function?? ***** Jake Palmer www.duke.edu/~jp6

    B 1 Reply Last reply
    0
    • J Jake Palmer

      Here's something that's puzzling me: the purpose of the callback function for AVISave is to update a Progress control with the percent done. But the callback function must be global or static, and only takes an int nPercent argument, so how can I access any Progress control or dialog member variables from this callback function?? ***** Jake Palmer www.duke.edu/~jp6

      B Offline
      B Offline
      Ben Burnett
      wrote on last edited by
      #2

      I think you might get away with something similar to the following; YourDialog.h:

      class CYourDialog : ... {

      static CYourDialog * pThis;
      static LONG SaveCallback ( int nPercent );

      };

      YourDialog.cpp:

      CYourDialog * CYourDialog::pThis = NULL;

      CYourDialog::CYourDialog () {
      pThis = this;
      }

      LONG CYourDialog::SaveCallback ( int nPercent ) {

      //
      // use the pThis pointer to access the members/variables of your class
      //
      

      }

      Ben Burnett --------- On the topic of code with no error handling -- It's not poor coding, it's "optimistic" ;)

      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