On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0
Declare Sub CrashVB Lib "msvbvm60" (Optional DontPassMe As Any)
On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0
Declare Sub CrashVB Lib "msvbvm60" (Optional DontPassMe As Any)
Well, partly it has to do with the topic. But, the project is code imposes sabsclassing on standard components.
Code:Public Sub SetupVisualStyles(ByVal Form As VB.Form) If GetComCtlVersion() >= 6 Then SendMessage Form.hWnd, WM_CHANGEUISTATE, MakeDWord(UIS_CLEAR, UISF_HIDEFOCUS Or UISF_HIDEACCEL), ByVal 0& If EnabledVisualStyles() = False Then Exit Sub Dim CurrControl As Control For Each CurrControl In Form.Controls Select Case TypeName(CurrControl) Case "Frame" RemoveVisualStyles CurrControl.hWnd SetWindowSubclass CurrControl.hWnd, AddressOf RedirectFrame, ObjPtr(CurrControl), 0 Case "CommandButton", "CheckBox", "OptionButton" If CurrControl.Style = vbButtonGraphical Then If CurrControl.Enabled = True Then SetProp CurrControl.hWnd, StrPtr("Enabled"), 1 SetWindowSubclass CurrControl.hWnd, AddressOf RedirectButton, ObjPtr(CurrControl), ObjPtr(CurrControl) End If End Select Next CurrControl End Sub
VB crashes after compiling the project, if you open a form MainForm in IDE
1. open CommonControls.vbp
2. MainForm.frm open in the GUI
3. compile the project
4. After compiling - Crash VB
Error occurs both on windows xp, and Windows 7.
The compiled exe with no problems
OK, I can confirm that on XP, the IDE does indeed crash while compiling the exe. I believe it's due to the heavy subclassing involved, even in the IDE. I think what happens is that some controls are destroyed "abruptly" by VB6, i.e., the UserControl_Terminate() doesn't fire, giving the UserControl(s) no chance of unsubclassing properly, thus causing a crash. Of course, the simplest workaround is to close the MainForm first before compiling. BTW, crashes are to be expected when subclassing, as it's very easy to reference invalid memory addresses.![]()
On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0
Declare Sub CrashVB Lib "msvbvm60" (Optional DontPassMe As Any)
You may want your post(s) to be transferred to the Fix Visual Styles Issues (Themes) thread, as it's the more appropriate thread. Ask a moderator about it by clicking the black triangle icon on the bottom left side of your post.
On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0
Declare Sub CrashVB Lib "msvbvm60" (Optional DontPassMe As Any)
If you set by the StatusBar the compile option "ImplementDesignModeSubclass" to False then it should not crash anymore when you compile your project with a opened form that contains a StatusBar.
Last edited by Krool; May 20th, 2013 at 11:12 AM.
Only the latest version on 9/may has crash issue while compiling with Mainform open after you updated SubclassProc. I didn't see any crash before. Please double check where and what you have modified since last update.
Lovely controls. I see however, that the MOUSEUP event works kinda wierd. (I am specifically referring to the listview control). When I right-click an item in the listview, the MOUSEUP event does not fire. Double-clicking (right button) does fire the event. Is this by design (different to the way the listview works in VB6) or did I miss something?