Click here to Skip to main content
Click here to Skip to main content

Using the IE 5 built-in progress dialog

By , 6 Feb 2000
 
  • Download sample project - 20K
  • The progress dialog

    It's one of those boring tasks we all hate to do: writing a progress dialog. It ranks right up there with typing "ListView_SetExtendedListViewStyleEx". And even if you're able to reuse an existing dialog, it might not look just the way you want it to, or it might be tough to integrate into your code.

    Fortunately, IE 5 saves us from having to build a dialog or write code to handle a Cancel button ever again! The BROWSEUI.DLL file implements a COM interface called IProgressDialog that provides a dialog that looks like the one displayed by Explorer and SHFileOperation().

    The progress dialog has these features:

     [Dialog screen shot - 22K]

    The AVI file should be 272x60 and is subject to the normal restrictions of the animation common control. If you don't have an AVI of your own, MSVC comes with some sample ones (in the \common\graphics\avis directory on the CD), or you can open up shell32.dll in the resource editor and swipe one from there. (If you were wondering, I snagged the AVI in the screen shot above from Internet FastFind.)

    Even though the documentation states that you can remove the minimize button from the dialog, this appears to be broken, even in build 2195 of Windows 2000. The dialog will always have a minimize button (for the time being, until Microsoft fixes it).

    Since the COM methods have several flags and reserved parameters, I wrote a thin MFC wrapper class, CSHProgressWnd, that makes your code much more readable. The MFC class is not derived from CWnd since the COM interface doesn't provide access to the progress window directly. That means you can use the wrapper even in console apps or other situations where you don't use the CWnd framework. I don't use much MFC stuff (the features I use most are memory validation routines like AfxIsValidString()), so you can very easily remove the dependency on MFC if you so desire.

    If you're wondering about the name, I put the "SH" in the class name because MSDN states that the IProgressDialog interface is actually part of shell32.dll (and only available on Windows 2000!), and I used "SH" to indicate that it was a shell feature. I later discovered that the dialog works fine on older versions of Windows, but by that time I'd finished the code.

    CSHProgressWnd Functions

    Construction/destruction

    The CSHProgressWnd constructor creates an IProgressDialog object. On a properly-working system, this will always succeed. However, you can call the IsValid() function if you want to double-check that everything worked. Note that you must initialize OLE (such as with AfxOleInit()) before constructing a CSHProgressWnd object.

    The CSHProgressWnd destructor destroys the dialog and releases the COM interface.

    Dialog setup

    Call these functions to determine how the dialog will look.

    void SetTitle ( LPCTSTR szTitle )
    Sets the text that appears in the caption bar of the progress dialog.

    void SetAnimation ( HINSTANCE hinst, UINT uRsrcID )
    void SetAnimation ( UINT uRsrcID )

    Specifies a resource containing an AVI that will be shown in the dialog. The first function takes the HINSTANCE of the module containing the resource. The second form uses the return from AfxGetResourceHandle() as the module.

    void SetCancelMessage ( LPCTSTR szMessage )
    Sets the text that is shown on line 3 when the user clicks the Cancel button.

    void SetCalculateTime ( bool bCalculate = true )
    Sets whether the progress dialog shows an estimate of the time remaining on line 3. If you don't call SetCalculateTime(), the dialog defaults to showing the time remaining.

    void SetAllowMinimize ( bool bAllow = true )
    Sets whether the progress dialog includes a minimize button. If you don't call SetAllowMinimize(), the dialog defaults to having a minimize button. NOTE: Calling SetAllowMinimize(false) will not remove the minimize button; this appears to be a bug in the dialog implementation.

    void SetShowProgressBar ( bool bShow = true )
    Sets whether the progress dialog shows a progress bar. If you don't call SetShowProgressBar(), the dialog defaults to having a progress bar.

    Showing the dialog

    The progress dialog can be modal or modeless. Call one of these two functions to display the dialog.

    HRESULT ShowModal ( CWnd* pwndParent )
    Displays the dialog as a modal dialog. pwndParent is a pointer to the parent window. Test the return value with the SUCCEEDED() macro to determine if the dialog was created successfully. If the dialog is not created, the return value is the error returned by the IProgressDialog::StartProgressDialog() method.

    HRESULT ShowModeless ( CWnd* pwndParent )
    Same as ShowModal(), but the progress dialog is modeless instead of modal.

    Updating the progress

    void SetLineText ( DWORD dwLine, LPCTSTR szText, bool bCompactPath = false )
    Sets one of the three lines of text in the dialog. dwLine can be 1, 2, or 3. Lines 1 and 2 appear between the AVI and the progress bar, and line 3 appears under the progress bar. If you have the dialog calculate the time remaining (by calling SetCalculateTime(true)), the dialog uses line 3 to display the estimated time remaining, and that line is unavailable to SetLineText(). If you are displaying a file name or path, pass true for the third parameter to have the dialog shorten the path so it fits in the dialog.

    void UpdateProgress ( DWORD dwProgress, DWORD dwMax )
    void UpdateProgress ( DWORD dwProgress )

    UpdateProgress() sets the dialog's progress indicator. The first form of the function sets the current and maximum progress values. These may be, for example, 0 and 100, but the exact values are up to you. You must call the first form the first time, then afterwards you can call the second form as long as your maximum progress value does not change. You may freely change the maximum value if you need to, as long as you call the first form whenever the maximum value changes.

    void UpdateProgress ( ULONGLONG u64Progress, ULONGLONG u64ProgressMax )
    void UpdateProgress ( ULONGLONG u64Progress )

    These two functions work like the previous two, except they take 64-bit numbers instead of DWORDs.

    Other functions

    bool HasUserCanceled()
    You should call HasUserCanceled() periodically during your processing, and break out if the function returns true.

    void EndDialog()
    Call EndDialog() to close the progress dialog. The CSHProgressWnd destructor will also close the dialog if it is still visible.

    void ResetTimer()
    If you want to reset the timer used by the dialog to estimate the time remaining, call ResetTimer() at the beginning of your processing loop. The dialog uses the time between calls to ResetTimer() and UpdateProgress() to calculate the time remaining. Normally you won't need to call this function; if you don't call it, the dialog will base its estimate on the time elapsed between creation of the dialog (via ShowModal() or ShowModeless()) and the first call to UpdateProgress().

    Sample code that uses CSHProgressWnd

    void CMyDialog::ProcessSomeStuff()
    {
    CSHProgressWnd dlg;
    const DWORD    dwMax = 100;
    TCHAR          szMsg[256];
    
        dlg.SetTitle ( _T("Hang on a sec...") );
        dlg.SetAnimation ( IDR_PROGRESS_AVI );
        dlg.SetCancelMessage ( _T("Cancelling this operation...") );
        dlg.SetLineText ( 1, _T("Unzipping files...") );
    
        if ( FAILED( dlg.ShowModal ( this )))
            return;
    
        dlg.UpdateProgress ( 0, dwMax );
    
        for ( DWORD dwProgress = 0;
              dwProgress < dwMax && !dlg.HasUserCanceled();
              dwProgress += 5 )
            {
            DoSomeSlowProcessing();
    
            wsprintf ( szMsg, _T("I'm %lu%% done"), dwProgress );
    
            dlg.SetLineText ( 2, szMsg );
            dlg.UpdateProgress ( dwProgress );
            }
    
        dlg.EndDialog();
    }

    You can get updates to this and my other articles at http://home.inreach.com/mdunn/code/

    License

    This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

    A list of licenses authors might use can be found here

    About the Author

    Michael Dunn
    Software Developer (Senior) VMware
    United States United States
    Member
    Michael lives in sunny Mountain View, California. He started programming with an Apple //e in 4th grade, graduated from UCLA with a math degree in 1994, and immediately landed a job as a QA engineer at Symantec, working on the Norton AntiVirus team. He pretty much taught himself Windows and MFC programming, and in 1999 he designed and coded a new interface for Norton AntiVirus 2000.
    Mike has been a a developer at Napster and at his own lil' startup, Zabersoft, a development company he co-founded with offices in Los Angeles and Odense, Denmark. Mike is now a senior engineer at VMware.

    He also enjoys his hobbies of playing pinball, bike riding, photography, and Domion on Friday nights (current favorite combo: Village + double Pirate Ship). He would get his own snooker table too if they weren't so darn big! He is also sad that he's forgotten the languages he's studied: French, Mandarin Chinese, and Japanese.
     
    Mike was a VC MVP from 2005 to 2009.

    Sign Up to vote   Poor Excellent
    Add a reason or comment to your vote: x
    Votes of 3 or less require a comment

    Comments and Discussions

     
    You must Sign In to use this message board.
    Search this forum  
        Spacing  Noise  Layout  Per page   
    Questionfile download dialog boxmemberammupon18 Sep '08 - 0:04 
    Can anyone help me with the correct code please Smile | :) ...
    I want "file download dialog box" to get opened in all the browsers, when i open any link.
    GeneralCustom Cancel EventmemberAndrew Y27 Jan '06 - 0:11 
    Is it possible to customise the way cancel event is handled?
    GeneralShowModal bugmemberGideon712 Jan '06 - 5:26 
    The IProgressDialog object has a well-known bug with PROGDLG_MODAL. If progress dialog's parent window is the application's main window, your application can lose activation when the progress dialog closes.
     
    The result is that your application disappears behind the windows of other applications.
     
    The obvious workaround is ::SetForegroundWindow(hWndParent). But testing on XP and W2K3 SP1 shows that it does not work. Or at best works erratically.
     
    As far as I know there is no known workaround for this bug.
    GeneralRe: ShowModal bugmemberGideon712 Jan '06 - 7:49 
    I did some research and figured out why the bug is happening. StartProgressDialog creates a new thread to host the progress window. When the window receives WM_DESTROY message it ought to re-enable the parent window. But it doesn't. (This the bug.) Instead, StopProgressDialog() wrongly attempts to re-enable the parent in the calling thread (our thread), after the progress window is destroyed and the progress thread has died.
     
    When the progress window dies, the system tries to assign a new foreground window. It cannot assign to hwndParent because StartProgressDialog (w/PROGDLG_MODAL) disabled the parent window.
     
    So the system hands the foreground activation to the next process that wants it in the system foreground queue. Thus we lose our right to recapture the foreground window. I'm assuming SPI_SETFOREGROUNDLOCKTIMEOUT is non-zero, which is true by default on XP and W2K3.
     
    What makes things really interesting is that if you happen to attach a debugger to the process (for example to try to figure out this crazy bug), USER32 changes its behavior! When a debugger is attached it always honors SetForegroundWindow. Talk about your Heisenbug Frown | :-( .
     
    The way to fix this bug is to insert a call to EnableWindow(hWndParent) in the WM_DESTROY handler for the progress window in the progress thread. But short of patching USER32.DLL this is impossible Frown | :-( .
     
    You can't even simulate modality by wrapping the progress window with ::EnableWindow(hWndParent, FALSE/TRUE). This is because the parent must be re-enable before the progress window dies to prevent losing the foreground.
     
    As far as I can figure, there ain't no way.
    GeneralRe: ShowModal bugmemberpeterchen31 Jan '07 - 22:34 
    Gideon7 wrote:
    You can't even simulate modality by wrapping the progress window with ::EnableWindow(hWndParent, FALSE/TRUE). This is because the parent must be re-enable before the progress window dies to prevent losing the foreground.

     
    Couldn't then calling EnableWindow() / SetForegroundWindow() before StopProgressDialog() help?
    -----
     
    btw. I have a different problem with it (since you seem to have digged in quite deeply, I take the liberty to ask here.):
     
    The progress dialog sometimes doesn't disappear. It almost always happens if it is visible only for a short time, and never happens when it's displayed for longer than 5 seconds
     
    Things that make the dialog go away: mousing over it, Sleep(5500) before or after StopProgressDialog(), opening a context menu in the parent window. Do you have any idea what could make this happen?
     


     


    Developers, Developers, Developers, Developers, Developers, Developers, Velopers, Develprs, Developers!
    We are a big screwed up dysfunctional psychotic happy family - some more screwed up, others more happy, but everybody's psychotic joint venture definition of CP
    Linkify!|Fold With Us!

    AnswerRe: ShowModal bugmemberMandatoryDefault14 Oct '09 - 12:20 
    I had the same problem where the window wouldn't go away even after calling StopProgressDialog(). When I added an AVI animation to the dialog, the problem went away. This was on Windows 7.
     
    Also, I did not see the focus bug appear in Windows 7.
    QuestionGreat Article - Quick Question...memberrobosport29 Dec '05 - 5:25 
    Thank you for writing this. Very informative. The wrapper alone saved me at least a couple of hours in reading time (probably more). Wink | ;)
     
    Is there a way to control where on the screen the progress dialog is positioned (without polling for the creation of the dialog window)?
     
    For example is there an easy way to specifiy that it should be centered like it is when IE pops it up? For some reason, on my system, it is poping up about 150 pixels from left and 50 pixels from top every time.
     
    Thanks again!
    JokeRe: Great Article - Quick Question...memberrobosport29 Dec '05 - 6:13 
    I found a solution to my question using IOleWindow. I thought it would be useful for others so I'm sharing here.
     
    I don't have time to write an article on this extension to yours but this solution could easily be used to modify the progress dialog... like removing the cancel button and resizing the dialog after the cancel button is removed, etc.
     
    For now here is the code change to center the progress dialog on the screen. I modified ShowModal after it succeeds in calling StartProgressDialog. I query the IOleWindow interface from the m_pIDlg inteface pointer. From there I just get the dialog's HWND. You do not need to wait for the dialog to display if you call this here after StartProgressDialog is called.
     

    HRESULT CSHProgressWnd::ShowModal ( CWnd* pwndParent )
    {
    HRESULT hr;
     
    ASSERT ( m_bValid );
    ASSERT_VALID ( pwndParent );
     
    hr = m_pIDlg->StartProgressDialog ( pwndParent->GetSafeHwnd(),
    NULL,
    m_dwDlgFlags | PROGDLG_MODAL,
    NULL );
     
    if ( SUCCEEDED(hr) )
    {
    m_bDlgVisible = true;
     
    // >>>Added: get IOleWindow interface to reposition
    IOleWindow* pIWnd = NULL;
    if ( m_pIDlg->QueryInterface( IID_IOleWindow, (void**)&pIWnd ) == S_OK )
    {
    HWND hWnd = NULL;

    if ( pIWnd->GetWindow( &hWnd ) == S_OK )
    {
    // get center of screen
    HDC hScreenDC = CreateCompatibleDC( NULL );
    int screenWidth = GetDeviceCaps( hScreenDC, HORZRES );
    int screenHeight = GetDeviceCaps( hScreenDC, VERTRES );
    DeleteDC( hScreenDC );
     
    // get dialog size
    RECT dialogRect;
    GetWindowRect( hWnd, &dialogRect );
     
    // calculate center position for dialog and reposition
    int centerX = ( screenWidth - ( dialogRect.right - dialogRect.left ) ) / 2;
    int centerY = ( screenHeight - ( dialogRect.bottom - dialogRect.top ) ) / 2;
    SetWindowPos( hWnd, NULL, centerX, centerY, 0, 0, SWP_NOSIZE | SWP_NOZORDER );
    }
    }
     
    pIWnd->Release();
    pIWnd = NULL;
    }
     
    return hr;
    }

    GeneralRe: Great Article - Quick Question...sitebuilderMichael Dunn31 Dec '05 - 10:07 
    Cool Smile | :) Is it documented anywhere that the CLSID_ProgressDialog coclass implements IOleWindow?
     
    --Mike--
    Visual C++ MVP Cool | :cool:
    LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
    #include "witty-quote.h"
    GeneralRe: Great Article - Quick Question...memberrobosport31 Dec '05 - 10:38 
    I have not seen it in any formal IProgressDialog documentation. I was lucky stumbling accross a reference to it using Google and found this VB article. It sure is useful to know:
    http://www.msjogren.net/dotnet/eng/samples/vb6_progdlg.asp[^]
     
    Its nice not having to wait for the dialog timer to display itself before making modifications, and obviously anyone can make just about any modifications once you have the dialog's HWND.
     
    Thanks again,
    robo
    GeneralChanging project namememberkk_vp1 Sep '05 - 0:06 

    Hi,
    I started building a project with some name - kktest.
     
    I get all file names with that name and exe also with that name.
    Now, I want to change the name to something better so that it will be reflected everywhere.
    Is it posiible??Confused | :confused:
     
    - KK
    GeneralRe: Changing project namesitebuilderMichael Dunn1 Sep '05 - 5:56 
    The workspace/project files (.dsw/.dsp or .sln/.vcproj) are text, so you can try doing a search/replace in them.
     
    --Mike--
    Visual C++ MVP Cool | :cool:
    LINKS~! Ericahist | 1ClickPicGrabber | NEW~! CP SearchBar v3.0 | C++ Forum FAQ
    #include "witty-quote.h"
    GeneralProgress dialog can be re-sizedmemberSimon Reeves25 Aug '04 - 6:35 
    The progress dialog can be resized while it is visible. This is achieved by right clicking on the menu bar and selecting size. Does anybody know of a way to disable this functionality on the window?
    QuestionDialog goes full-screen, happened to abybody ?memberohadp3 Apr '04 - 21:33 
    I use IProgressDialog indirectly (I make a windows call that brings up a progress-bar for copying/etc), and this dialog goes fullscreen.
     
    This happens on a very specific time (the first time I do the action after installing my application) which is somewhat odd to me because I don't fiddle with the call itself.
     
    Does anybody have an idea of what could cause this dialog to go full-screen ?
    btw: clicking it's 'restore-down' button brings it back to normal size...
     
    thanks
    GeneralGreat Job...one questionmemberVirtualM12 May '03 - 7:58 
    I want to know when the windows is showed then start the loop with my calculations. Bcs when i start the progress window the progress bar is already filled like 60%. It's like my loop is running but i can't see the progress window.
     
    Regards
    VirtualM
    GeneralRe: Great Job...one questionsitebuilderMichael Dunn13 May '03 - 19:08 
    That's the correct behavior. If your loop starts, then ends right away, the dialog won't be shown
     
    --Mike--
    Latest blog entry: *drool* (Alyson) [May 10]
    Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber
    "You have Erica on the brain" - Jon Sagara to me

    GeneralRe: Great Job...one questionmemberpkapple6 Jan '04 - 23:02 
    but, I want to start the progress window when start the loop with my calculations!??what should i do ???
    GeneralRe: Great Job...one questionmemberpeterchen31 Jan '07 - 22:39 
    The dialog delays 2 seconds before it shows itself (to avoid it just "flashing" on the screen). According to the docs and everything I found, there is no way around it.
     


    Developers, Developers, Developers, Developers, Developers, Developers, Velopers, Develprs, Developers!
    We are a big screwed up dysfunctional psychotic happy family - some more screwed up, others more happy, but everybody's psychotic joint venture definition of CP
    Linkify!|Fold With Us!

    GeneralWindows 95/98/NTmemberWarren Gardner22 Oct '02 - 11:45 
    The documentation for the IProgressDialog interface says that the minimum operating system is 2000/Me. But in your article you say that you found it "works fine on older versions of Windows".
     
    Anyone use this on versions earlier than 2000/Me?
    It would be useful to know what operating systems this will work on.

    GeneralRe: Windows 95/98/NTmemberMr Scotty25 Feb '03 - 23:10 
    I just tried the demo on NT4 and it looked OK
    Smile | :)
    Generalplatform sdkmemberberginan27 Jun '02 - 15:47 
    I've downloaded platfrom sdk from
    http://www.microsoft.com/msdownload/platformsdk/sdkupdate/
    however shlobj.h doesnot contain IProgressDialog.h can someone please let me know location of platform sdk that contains IProgressDialog.h.
    regards
    GeneralAny way to disable the CANCEL buttonmemberGreg Strauss29 Aug '01 - 13:32 
    In some circumstances, I can see it being useful to disable the Cancel button (even though it should be avoided if possible). I don't see a way in IProgressDialog that this can be done. Is there a way?
     
    Thx!
    GeneralRe: Any way to disable the CANCEL buttonmemberMr Scotty26 Feb '03 - 19:49 
    We used the following solution.
    We find the dialog with the dialog title we have set.
    Therefore we have to wait for the dialog to appeare. (solved also oure problem that we already had processed a lot without seeing it).
    On the dialog we search for the cancel button.
    if we find it we hide the button
     
    HWND hDialog = NULL;
    UINT nDialogWaitTime = 0;
     
    // Wait until dialog is available.
    while (hDialog == NULL &&
    nDialogWaitTime < mv_nMaxDialogWaitTime) // Don't wait forever
    {
    hDialog = ::FindWindow(NULL, mv_pszDialogTitle);
    if (hDialog != NULL)
    {
    HWND hCancelButton = ::FindWindowEx(hDialog, NULL, _T("BUTTON"), _T("Cancel"));
    if (hCancelButton != NULL)
    {
    ::ShowWindow(hCancelButton, SW_HIDE);
    }
    }
    else
    {
    ::Sleep(mv_nDialogPollTime); // Don't eat al the cpu time
    nDialogWaitTime += mv_nDialogPollTime;
    }
    }

    GeneralRe: Any way to disable the CANCEL buttonmembersongbo10 Feb '06 - 6:49 
    Hi,
     
    I've tried this solution after i perform the ShowModal(). Problem is that the dialog appears to late. If i wait 20s( mv_nMaxDialogWaitTime = 20000) seconds after showmodal the dialog still hasn't appeared Cry | :(( . The dialog appears after i have disposed the dialog memory. Can u plz help? Confused | :confused:
     
    -- modified at 12:50 Friday 10th February, 2006
    GeneralI got 33 errorsmemberBLaZe13 Jun '01 - 18:17 
    I'm just being compile the programfor the first time and I got 33 errors
     
    can you explain me why I got these errors
     
    I'm on Win2K Pro SP 2 Visual C++ 6.0 SP5 and I use IE 5.00.3315.1000
     
    TIAConfused | :confused:
     
    BLaZe
    GeneralRe: I got 33 errorsmemberMichael Dunn13 Jun '01 - 18:38 
    Post the error messages.
     
    --Mike--
    http://home.inreach.com/mdunn/
    #include "buffy_sig"
    GeneralRe: I got 33 errorsmembersajal4 Dec '01 - 10:48 
    D:\mydata\c++\IProgressDialog_demo\IProgDlg\shprogresswnd.h(70) : error C2143: syntax error : missing ';' before '*'
    D:\mydata\c++\IProgressDialog_demo\IProgDlg\shprogresswnd.h(70) : error C2501: 'IProgressDialog' : missing storage-class or type specifiers
    D:\mydata\c++\IProgressDialog_demo\IProgDlg\shprogresswnd.h(70) : error C2501: 'm_pIDlg' : missing storage-class or type specifiers
    D:\mydata\c++\IProgressDialog_demo\IProgDlg\IProgDlgDlg.cpp(123) : warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning)
    D:\mydata\c++\IProgressDialog_demo\IProgDlg\IProgDlgDlg.cpp(124) : warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning)
    D:\mydata\c++\IProgressDialog_demo\IProgDlg\IProgDlgDlg.cpp(125) : warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning)
    SHProgressWnd.cpp
    D:\mydata\c++\IProgressDialog_demo\IProgDlg\SHProgressWnd.h(70) : error C2143: syntax error : missing ';' before '*'
    D:\mydata\c++\IProgressDialog_demo\IProgDlg\SHProgressWnd.h(70) : error C2501: 'IProgressDialog' : missing storage-class or type specifiers
    D:\mydata\c++\IProgressDialog_demo\IProgDlg\SHProgressWnd.h(70) : error C2501: 'm_pIDlg' : missing storage-class or type specifiers
    D:\mydata\c++\IProgressDialog_demo\IProgDlg\SHProgressWnd.cpp(47) : error C2065: 'PROGDLG_NORMAL' : undeclared identifier
    D:\mydata\c++\IProgressDialog_demo\IProgDlg\SHProgressWnd.cpp(49) : error C2614: 'CSHProgressWnd' : illegal member initialization: 'm_pIDlg' is not a base or member
    D:\mydata\c++\IProgressDialog_demo\IProgDlg\SHProgressWnd.cpp(52) : error C2065: 'CLSID_ProgressDialog' : undeclared identifier
    D:\mydata\c++\IProgressDialog_demo\IProgDlg\SHProgressWnd.cpp(53) : error C2065: 'IID_IProgressDialog' : undeclared identifier
    D:\mydata\c++\IProgressDialog_demo\IProgDlg\SHProgressWnd.cpp(53) : error C2065: 'm_pIDlg' : undeclared identifier
    D:\mydata\c++\IProgressDialog_demo\IProgDlg\SHProgressWnd.cpp(64) : error C2227: left of '->StopProgressDialog' must point to class/struct/union
    D:\mydata\c++\IProgressDialog_demo\IProgDlg\SHProgressWnd.cpp(66) : error C2227: left of '->Release' must point to class/struct/union
    D:\mydata\c++\IProgressDialog_demo\IProgDlg\SHProgressWnd.cpp(82) : error C2227: left of '->SetTitle' must point to class/struct/union
    D:\mydata\c++\IProgressDialog_demo\IProgDlg\SHProgressWnd.cpp(91) : error C2227: left of '->SetAnimation' must point to class/struct/union
    D:\mydata\c++\IProgressDialog_demo\IProgDlg\SHProgressWnd.cpp(100) : error C2227: left of '->SetAnimation' must point to class/struct/union
    D:\mydata\c++\IProgressDialog_demo\IProgDlg\SHProgressWnd.cpp(112) : error C2227: left of '->SetCancelMsg' must point to class/struct/union
    D:\mydata\c++\IProgressDialog_demo\IProgDlg\SHProgressWnd.cpp(120) : error C2065: 'PROGDLG_NOTIME' : undeclared identifier
    D:\mydata\c++\IProgressDialog_demo\IProgDlg\SHProgressWnd.cpp(120) : error C2065: 'PROGDLG_AUTOTIME' : undeclared identifier
    D:\mydata\c++\IProgressDialog_demo\IProgDlg\SHProgressWnd.cpp(134) : error C2065: 'PROGDLG_NOMINIMIZE' : undeclared identifier
    D:\mydata\c++\IProgressDialog_demo\IProgDlg\SHProgressWnd.cpp(143) : error C2065: 'PROGDLG_NOPROGRESSBAR' : undeclared identifier
    D:\mydata\c++\IProgressDialog_demo\IProgDlg\SHProgressWnd.cpp(164) : error C2227: left of '->StartProgressDialog' must point to class/struct/union
    D:\mydata\c++\IProgressDialog_demo\IProgDlg\SHProgressWnd.cpp(166) : error C2065: 'PROGDLG_MODAL' : undeclared identifier
    D:\mydata\c++\IProgressDialog_demo\IProgDlg\SHProgressWnd.cpp(189) : error C2227: left of '->StartProgressDialog' must point to class/struct/union
    D:\mydata\c++\IProgressDialog_demo\IProgDlg\SHProgressWnd.cpp(223) : error C2227: left of '->SetLine' must point to class/struct/union
    D:\mydata\c++\IProgressDialog_demo\IProgDlg\SHProgressWnd.cpp(243) : error C2227: left of '->SetProgress' must point to class/struct/union
    D:\mydata\c++\IProgressDialog_demo\IProgDlg\SHProgressWnd.cpp(258) : error C2227: left of '->SetProgress' must point to class/struct/union
    D:\mydata\c++\IProgressDialog_demo\IProgDlg\SHProgressWnd.cpp(279) : error C2227: left of '->SetProgress64' must point to class/struct/union
    D:\mydata\c++\IProgressDialog_demo\IProgDlg\SHProgressWnd.cpp(294) : error C2227: left of '->SetProgress64' must point to class/struct/union
    D:\mydata\c++\IProgressDialog_demo\IProgDlg\SHProgressWnd.cpp(307) : error C2227: left of '->HasUserCancelled' must point to class/struct/union
    D:\mydata\c++\IProgressDialog_demo\IProgDlg\SHProgressWnd.cpp(317) : error C2227: left of '->StopProgressDialog' must point to class/struct/union
    D:\mydata\c++\IProgressDialog_demo\IProgDlg\SHProgressWnd.cpp(333) : error C2227: left of '->Timer' must point to class/struct/union
    D:\mydata\c++\IProgressDialog_demo\IProgDlg\SHProgressWnd.cpp(333) : error C2065: 'PDTIMER_RESET' : undeclared identifier
    Generating Code...
    Error executing cl.exe.
     
    IProgDlg.exe - 33 error(s), 3 warning(s)

     
    http://sachdevs.tripod.com
    GeneralRe: I got 33 errorsmemberMichael Dunn4 Dec '01 - 11:09 
    Download the latest Platform SDK. See the VC forum FAQ.
     
    --Mike--
    http://home.inreach.com/mdunn/
    While I can't be correct on all matters, I can make the reassuring claim that where I am inaccurate, I am at least definitively inaccurate.
    Heart | [heart] your Green Alien | [Alien] with Good Stuff | [The good stuff] and Beer | [beer]
    Sonork - 100.10414 AcidHelm
    GeneralRe: I got 33 errorsmemberGriv9 May '04 - 21:56 
    Love your Code Project with Vegemite and ?
     
    Is it coffee, tea or a mouse?
    GeneralUndeclared IdentifiermemberShane Whitfield30 Mar '01 - 11:47 
    I am trying to use the IProgressDialog interface, but I keep getting an undeclared identifier error when I compile under Windows 2000 using VC++ 6.0. I have declared the header files as shown and I am still not getting it right. Please help
    GeneralRe: Undeclared IdentifiermemberAlex Blekhman8 Apr '01 - 20:12 
    Make sure that ShlGuid.h is included and _WIN32_IE defined >= 0x0500
    GeneralProblem with NT4, IE5.0memberAlex Blekhman29 Mar '01 - 1:15 
    When using under NT4 with IE5.0 progress bar doesn't disappear in spite of PROGDLG_NOPROGRESSBAR flag. Any ideas?
    GeneralVC++ 6memberFrank Hale19 Nov '00 - 17:32 
    So whats a guy to do if he only has VC++ 5? Is there anyway to compile this code? Or any other code that is for VC++ 6?
    Is there some download I can use to update my libs and include files? It seems like if you have anything less that version 6 you are up sh*t creek. Thats pretty bad when the thing costs 500 dollars and is obsolete when a new version comes out.

    GeneralRe: VC++ 6memberMichael Dunn19 Nov '00 - 18:44 
    I believe the Platform SDK works with VC 5, so you can try downloading the minimum PSDK fileset (about 12 MB, it's the default install).
     
    --Mike--
    http://home.inreach.com/mdunn/
    "That probably would've sounded more commanding if I wasn't wearing my yummy sushi pajamas."
    -- Buffy

    GeneralHeaderssussDon Sanders4 Oct '00 - 12:33 
    My shlobj.h and shlquid.h do not have IProgressDialog.h. Where can I get them? Can someone post them
    GeneralRe: HeaderssussMichael Dunn4 Oct '00 - 16:02 
    The latest headers are available from MS in the Platform SDK
    QuestionHeaders & Libs?sussSteven Carleton17 Feb '00 - 16:12 
    So, I guess we need the latest SDK?
    MSDN states on the IProgressDialog page
    that you need Win2k ?
    AnswerRe: Headers & Libs?sussMike Dunn26 Feb '00 - 7:28 
    You do need the latest header files from the SDK. The IProgressDialog interface and flags are defined in shlobj.h, and the GUIDs are in shlguid.h. You don't need a LIB since it's a COM object.
     
    The docs are *wrong* in stating that this is available only on Win 2K. It's an IE 5 feature and will work on any OS
    GeneralFantastic!sussJason Hattingh9 Feb '00 - 0:29 
    So cool - thanks, geez

    General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

    Permalink | Advertise | Privacy | Mobile
    Web02 | 2.6.130523.1 | Last Updated 7 Feb 2000
    Article Copyright 2000 by Michael Dunn
    Everything else Copyright © CodeProject, 1999-2013
    Terms of Use
    Layout: fixed | fluid