This article was previously published under Q189632
This article has been archived. It is offered "as is" and will no longer be updated.
When using a CoolBar control, your compiled application hangs or generatesan exception error or invalid page fault (IPF.)
An unhandled error occurred in one of the CoolBar's Events.
Handle the error with an On Error routine.
Microsoft has confirmed this to be a bug in the Microsoft products listedat the beginning of this article. We are researching this bug and will postnew information here in the Microsoft Knowledge Base as it becomesavailable.
This problem only occurs in the compiled application and does not occurfrom the IDE. When an unhandled error occurs in one of the CoolBar'sevents, it hangs the application in Windows 95, but under Windows 2000, Windows NT 4, Windows 98, or Windows Me, it may produce an exception or IPF error.
Steps to Reproduce Behavior
Open a New Standard EXE project. Form1 is created by default.
Choose Components from the Project menu, check "Microsoft Windows Common Controls-3" and click OK.
Place a CoolBar control onto the form. CoolBar1 is created by default.
Place this code in the form's module:
Private Sub CoolBar1_Click() Err.Raise 5 End Sub
Choose Make exe from the File menu, and create an executable file.
Run the exe and click on the CoolBar control. (NOTE: You must click on one of the bars that separates the Bands rather than the Bands themselves.)
You should get a dialog for Run-time error '5': "Invalid procedure call or argument" and the application should end. Instead, the application will either hang or generate an exception error or IPF.
Replace the code in the CoolBar's Click Event with this code which contains an error handler:
Private Sub CoolBar1_Click() On Error Goto CBErr Err.Raise 5 Exit Sub CBErr: MsgBox "Error " & Err.Number & ": " & Err.Description Resume Next End Sub
Repeat steps 5 and 6. This time you will get an error message, after which the application continues running normally.