Example for using GM_SetProgressCallback

fxrazno1fxrazno1 Global Mapper UserPosts: 33Trusted User
edited January 2011 in SDK
Hi
Can any body give me an example with instructions how to use the
GM_SetProgressCallback function.
Thanks Allot
Raz

Comments

  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited January 2011
    Raz,

    The GMDLL_TesterDlg.cpp file has a sample of using the progress callback. Here is the progress callback function from that file:
    //===================================================================
    //
    // FUNCTIONS:
    //   ProgressCallbackFunc
    //
    // DESCRIPTION:
    //   Callback function for handling progress display. You would
    //   implement this and pass it to the SDK via the 
    //   GM_SetProgressCallback function if you wanted to handle
    //   progress in some non-default way. This should return TRUE
    //   unless you want to abort the operation that the progress is
    //   being reported on.
    //
    //===================================================================
    static boolean 
    _stdcall ProgressCallbackFunc
        ( 
        uint32                  aOperationIdx,  // index of operation this progress applies to (useful if nested long operations or multiple threads)
        GM_ProgressUpdate_t8    aUpdateType,    // what kind of progress update is it
        const char*             aStatus,        // current status string
        uint32                  aPercent        // percent complete
        )
    {
        // No progress display here, just return TRUE to keep going
        return ( TRUE );
    } // end of function ProgressCallbackFunc
    

    To set this as the progress callback you would just make the following call:

    GM_SetProgressCallback( (GM_ProgressCallbackFunc)ProgressCallbackFunc );

    Then any progress dialogs that would display would instead make calls to the ProgressCallbackFunc. You can then display your own progress bar or do whatever you deem appropriate with the status information.

    Let me know if I can be of further assistance.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
Sign In or Register to comment.