Correct fix for shutdown crash when XP manifest applied

Summary

Id: 5294.1
Type: Issue Issue
Current Status: Resolved

Detail

15 Jun 2003 Open Michael Bell

A newsgroup article deals with the manifest user control issue. First the EXCERPTED ARTICLE, then the mods I stuck in the control:

First of all, please refer to

http://support.microsoft.com/default.aspx?scid=kb;en-us;309366

“Visual Basic 6.0 Does Not Support Windows XP Themes or Visual Styles”

To work around the problem, please use the following code.

Private Declare Sub InitCommonControls Lib "comctl32.dll" ()Private Declare Function LoadLibrary Lib "kernel32" Alias "LoadLibraryA" _ (ByVal lpLibFileName As String) As LongPrivate Declare Function FreeLibrary Lib "kernel32" (ByVal hLibModule AsLong) As LongDim hMod As LongPrivate Sub Form_Initialize() hMod = LoadLibrary("shell32.dll") InitCommonControlsEnd SubPrivate Sub Form_Unload(Cancel As Integer) Call FreeLibrary(hMod)End Sub

In the control I pretty much used the above code, but stuck the appropriate stuff in UserControl_Initialize and UserControl_Terminate. It worked – no longer do I crash after clicking an item and then exiting the test demo.

22 Jun 2003 Resolved Steve McMahon

Updated the article on the site to add this information.