Page 2 of 2 FirstFirst 12
Results 41 to 50 of 50

Thread: CommonControls (Replacement of the MS common controls)

  1. #41
    Frenzied Member Bonnie West's Avatar
    Join Date
    Jun 12
    Location
    InIDE
    Posts
    1,621

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Romeo91 View Post
    I have one problem, very often crashes when you compile an application (even an example), and the exe-file is created. And sometimes crashes when you press End in the course of the program.
    Can you tell us how to replicate your "problem"? Can you also point out the code that you suspect is causing the problem?
    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)

  2. #42
    Frenzied Member Bonnie West's Avatar
    Join Date
    Jun 12
    Location
    InIDE
    Posts
    1,621

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Romeo91 View Post
    Also for the beautiful subsclassing commandbutton think it will be good to make changes if there is a caption and a picture, you have the image on the left and the caption to the left of the picture. So the picture will not be imposed on the text.
    Is that somehow related to this thread? Also, I think what you're saying, is that you want both the button icon and text to be on the left side of the button. Is this correct?
    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)

  3. #43
    New Member
    Join Date
    Mar 12
    Posts
    9

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Bonnie West View Post
    Is that somehow related to this thread? Also, I think what you're saying, is that you want both the button icon and text to be on the left side of the button. Is this correct?
    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

  4. #44
    New Member
    Join Date
    Mar 12
    Posts
    9

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Bonnie West View Post
    Can you tell us how to replicate your "problem"? Can you also point out the code that you suspect is causing the problem?
    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

  5. #45
    Frenzied Member Bonnie West's Avatar
    Join Date
    Jun 12
    Location
    InIDE
    Posts
    1,621

    Re: CommonControls (Replacement of the MS common controls)

    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)

  6. #46
    Frenzied Member Bonnie West's Avatar
    Join Date
    Jun 12
    Location
    InIDE
    Posts
    1,621

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Romeo91 View Post
    Well, partly it has to do with the topic. But, the project is code imposes sabsclassing on standard components.
    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)

  7. #47
    Member
    Join Date
    Jun 12
    Posts
    36

    Re: CommonControls (Replacement of the MS common controls)

    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.

  8. #48
    Addicted Member
    Join Date
    Jan 10
    Posts
    237

    Re: CommonControls (Replacement of the MS common controls)

    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.

  9. #49
    New Member
    Join Date
    Mar 12
    Posts
    9

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Krool View Post
    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.
    Thank you. This solution helped.

  10. #50
    New Member
    Join Date
    May 13
    Posts
    1

    Re: CommonControls (Replacement of the MS common controls)

    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?

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •