Page 46 of 94 FirstFirst ... 364344454647484956 ... LastLast
Results 1,801 to 1,840 of 3726

Thread: CommonControls (Replacement of the MS common controls)

  1. #1801
    Fanatic Member
    Join Date
    Apr 2015
    Posts
    524

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Krool View Post
    Update released.
    The performance of the ToolBar has been increased.
    This was achieved by internally doing at some points (if applicable) a invalidation instead of a refresh.
    Very good, works well, thanks.

    Changing .TextAlignment will cause re-creating of the control. During the re-creation LockWindowUpdate is used:
    Maybe LockWindowUpdate does cause a screen flicker in your particular app, just a guess.
    It does.
    I don't use LockWindowUpdate in the app, which could be the cause.
    Also I don't know of other controls that do, at least I can't find because they are compiled (CC5).

    Refer to http://www.vbforums.com/showthread.p...=1#post5108773 for reason and explanation.
    Understood.
    This improvement will work for sure if VBCCR is alone in the world.

    Solution could be to set the .TextAlignment already at design-time to the wanted value.
    This solution works very ok.
    Changing .TextAlignment is very unlikely.
    Flickering is solved so far.

  2. #1802

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,374

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Karl77 View Post
    Understood.
    This improvement will work for sure if VBCCR is alone in the world.
    Also see http://fgaillard.com/2011/02/the-unf...-wm_setredraw/

    I won't switch back to WM_SETREDRAW.

  3. #1803
    Fanatic Member
    Join Date
    Apr 2015
    Posts
    524

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Krool View Post
    Very informative.
    The desktop flicker occurs when the handle is 0, right?

    My initial problem is solved anyway.
    But it is interesting why the flicker comes up in your Recreate.

    I won't switch back to WM_SETREDRAW.
    Why should you?

  4. #1804
    Fanatic Member
    Join Date
    Apr 2015
    Posts
    524

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Krool View Post
    The performance of the ToolBar has been increased.
    This was achieved by internally doing at some points (if applicable) a invalidation instead of a refresh.
    I forgot to report the advantage.
    Before: 250 msec. and more
    Now: 16 msec., and less

  5. #1805
    Hyperactive Member Mith's Avatar
    Join Date
    Jul 2017
    Location
    Thailand
    Posts
    445

    Question No unicode support at the list view event "OLEDragDrop"

    VBCCR14.OCX v1.4.0.50
    Control: ListView in Report mode

    hi krool,

    i drag and dropped a folder with unicode characters in the name from the windows explorer on the list view in report mode but the event "OLEDragDrop" just returns the folder path in ANSI and the unicode characters are replaced with char "?".

    Is this something you can fix?
    Last edited by Mith; Oct 2nd, 2017 at 05:38 AM.

  6. #1806
    Hyperactive Member Mith's Avatar
    Join Date
    Jul 2017
    Location
    Thailand
    Posts
    445

    Question List View "Right To Left" not work

    VBCCR14.OCX v1.4.0.50
    Control: ListView in Report mode

    Hi Krool,

    i use the following code with a list view in report mode but the content of the list view doesnt get mirrored as expected:

    lvwFF.RightToLeft = True
    lvwFF.RightToLeftLayout = True

    i tried that code with win7x64 and the display language arabic.

    Any ideas why this is not working?

    Name:  Screenshot - 02.10.2017 , 17_45_57.jpg
Views: 1829
Size:  5.7 KB

  7. #1807

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,374

    Re: List View "Right To Left" not work

    Quote Originally Posted by Mith View Post
    VBCCR14.OCX v1.4.0.50
    Control: ListView in Report mode

    Hi Krool,

    i use the following code with a list view in report mode but the content of the list view doesnt get mirrored as expected:

    lvwFF.RightToLeft = True
    lvwFF.RightToLeftLayout = True

    i tried that code with win7x64 and the display language arabic.

    Any ideas why this is not working?

    Name:  Screenshot - 02.10.2017 , 17_45_57.jpg
Views: 1829
Size:  5.7 KB
    How is .RightToLeftMode set?

  8. #1808
    Hyperactive Member Mith's Avatar
    Join Date
    Jul 2017
    Location
    Thailand
    Posts
    445

    Re: List View "Right To Left" not work

    How is .RightToLeftMode set?
    .RightToLeftMode = CCRightToLeftModeVBAME

    i didnt set/changed this option. its the standard value.

    ok, i could solve the problem after changing the value to:

    .RightToLeftMode =CCRightToLeftModeNoControl

    Name:  Screenshot - 02.10.2017 , 21_39_51.jpg
Views: 1625
Size:  4.9 KB

    thx for the hint!
    Last edited by Mith; Oct 2nd, 2017 at 09:40 AM.

  9. #1809

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,374

    Re: CommonControls (Replacement of the MS common controls)

    Update released.

    This time the CoolBar control got my attention to make the control better.

    First bugfix is that changing the VerticalGripper property on a vertical orientation CoolBar control was cumbersome.
    The solution was to reset all header size dimensions to -1, thus the control has to recalculate them.

    Second bugfix was that the HideCaption property of a Band was never written to the property bag.. easy fix to include in WriteProperties.

    The actual improvement (make the control better) is as following:

    The ForeColor of a Band (whether derived via 'UseCoolBarColors' or directly) was not supported when visual styles are applied.
    However, that improvement works only on Vista+ (minimum comctl32.dll 6.1) since DrawThemeTextEx is not supported in Windows XP.

    Name:  CoolBarThemedTextColor.png
Views: 1608
Size:  1.3 KB

    But there is another glitch that is fixed also for Windows XP. (MS never fixed this since Windows XP)
    However, that glitch does not appear when visual styles are not applied.

    The glitch can be replicated in following scenario:
    Orientation = 1 - Vertical
    VerticalGripper = True
    3 Bands with initial settings except MinHeight of 1st Band set to 800 and input Caption text of "asd asd yxcyxc".
    Then at run-time drag the band from left to right.

    Before:
    Name:  CoolBarGlitchBeforeFix.png
Views: 1588
Size:  2.2 KB

    After:
    Name:  CoolBarGlitchAfterFix.png
Views: 1602
Size:  2.3 KB

    As can be seen the text "asd asd yxcyxc" is measured by MS always on top-left and not the actual band coordinates.

    These enhancements can be switched off by the conditional compilation constant 'ImplementThemedReBarFix'.
    Last edited by Krool; Oct 4th, 2017 at 01:31 AM.

  10. #1810
    Hyperactive Member Mith's Avatar
    Join Date
    Jul 2017
    Location
    Thailand
    Posts
    445

    Re: No unicode support at the list view event "OLEDragDrop"

    Quote Originally Posted by Mith View Post
    VBCCR14.OCX v1.4.0.50
    Control: ListView in Report mode

    hi krool,

    i drag and dropped a folder with unicode characters in the name from the windows explorer on the list view in report mode but the event "OLEDragDrop" just returns the folder path in ANSI and the unicode characters are replaced with char "?".

    Is this something you can fix?
    i used this code:

    Code:
    Private Sub lvwTest_OLEDragDrop(data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, y As Single)
    
    Dim I As Long
    
    If data.GetFormat(vbCFFiles) Then
    
       For I = 1 To data.Files.Count
                
          ' data.Files.Item(I) is ANSI and contains no unicode characters
          
       Next I
    
    End If
    
    End Sub

  11. #1811

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,374

    Re: No unicode support at the list view event "OLEDragDrop"

    Quote Originally Posted by Mith View Post
    i used this code:

    Code:
    Private Sub lvwTest_OLEDragDrop(data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, y As Single)
    
    Dim I As Long
    
    If data.GetFormat(vbCFFiles) Then
    
       For I = 1 To data.Files.Count
                
          ' data.Files.Item(I) is ANSI and contains no unicode characters
          
       Next I
    
    End If
    
    End Sub
    http://cyberactivex.com/UnicodeTutor...gDrop_or_Paste

  12. #1812
    Hyperactive Member Mith's Avatar
    Join Date
    Jul 2017
    Location
    Thailand
    Posts
    445

    Re: No unicode support at the list view event "OLEDragDrop"

    How about we implement this inside VBCCR14.OCX to support unicode at the OLEDragDrop-event for all controls?

  13. #1813
    Fanatic Member
    Join Date
    Apr 2015
    Posts
    524

    Re: CommonControls (Replacement of the MS common controls)

    SUBCLASSING ADVICE

    Up to now I use SSUBTMR6.DLL for subclassing.
    From now on, I want to use the same technique that Krool uses in his controls.

    I'm stuck.
    Implements ISubclass creates the ISubclass_Message function, and I could do what I want from there.
    But I don't know how to bring messages into the game.
    In SSUBTMR6.DLL I simply had to attach/detach messages, which I could process in ISubclass_WindowProc.

    How does it work with Krool's subclassing?
    A very basic example would help me out.

    Thank you.

    Edit:
    I try this in the main form of the example (post #1).

  14. #1814
    PowerPoster
    Join Date
    Jun 2015
    Posts
    2,224

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Karl77 View Post
    SUBCLASSING ADVICE

    Up to now I use SSUBTMR6.DLL for subclassing.
    From now on, I want to use the same technique that Krool uses in his controls.

    I'm stuck.
    Implements ISubclass creates the ISubclass_Message function, and I could do what I want from there.
    But I don't know how to bring messages into the game.
    In SSUBTMR6.DLL I simply had to attach/detach messages, which I could process in ISubclass_WindowProc.

    How does it work with Krool's subclassing?
    A very basic example would help me out.

    Thank you.

    Edit:
    I try this in the main form of the example (post #1).
    Krool's method (common controls subclassing) does not filter messages. unless intercepted, you get them all.

    also you gotta make sure you forward to ComCtlsDefaultProc (DefSubclassProc) in your ISubclass_Message
    Code:
    Option Explicit
    
    Implements ISubclass
    
    Private Sub Form_Load()
        ComCtlsSetSubclass hWnd, Me, 0
    End Sub
    
    Private Sub Form_Unload(Cancel As Integer)
        ComCtlsRemoveSubclass hWnd
    End Sub
    
    Private Function ISubclass_Message(ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long, ByVal dwRefData As Long) As Long
        Select Case wMsg
            Case WM_DESTROY
        End Select
        ISubclass_Message = ComCtlsDefaultProc(hWnd, wMsg, wParam, lParam)
    End Function
    Last edited by DEXWERX; Oct 5th, 2017 at 12:38 PM.

  15. #1815
    Fanatic Member
    Join Date
    Apr 2015
    Posts
    524

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by DEXWERX View Post
    Krool's method (common controls subclassing) does not filter messages. unless intercepted, you get them all.

    also you gotta make sure you forward to ComCtlsDefaultProc (DefSubclassProc) in your ISubclass_Message
    Code:
    Option Explicit
    
    Implements ISubclass
    
    Private Sub Form_Load()
        ComCtlsSetSubclass hWnd, Me, 0
    End Sub
    
    Private Sub Form_Unload(Cancel As Integer)
        ComCtlsRemoveSubclass hWnd
    End Sub
    
    Private Function ISubclass_Message(ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long, ByVal dwRefData As Long) As Long
        Select Case wMsg
            Case WM_DESTROY
        End Select
        ISubclass_Message = ComCtlsDefaultProc(hWnd, wMsg, wParam, lParam)
    End Function
    Thank you DEXWERX.
    That was very helpful.

  16. #1816
    Fanatic Member
    Join Date
    Apr 2015
    Posts
    524

    Re: CommonControls (Replacement of the MS common controls)

    PAGER PROBLEMS

    See attached project.
    Pager.zip

    There are 3 Pagers.

    Pager1 (red) is vertical.
    Buddycontrol is Picture1, set at design time.

    Pager2 (blue) is horizontal.
    Buddycontrol is Picture2, set at design time.

    Pager3 (lila) is horizontal.
    Buddycontrol is Toolbar1, set at design time.

    a)
    When I start, only Pager3 catches the Buddy correct.
    To assign the Buddies in Form:Load doesn't help.
    When the Form is loaded, the CommandButton works to do it.

    b)
    Now let's resize the form manually.
    Watch the Pager Buttons.
    The Pager shows it's Button wrong.
    It doesn't refer to the contained window size.
    Also when we resize back and forth, this Button shows up at different window sizes.


    ---

    With a toolbar as the contained window, it works ok.

    Do I do something wrong, or is a PictureBox not suitable for a Pager?

    Thanks
    Karl

  17. #1817
    Hyperactive Member Mith's Avatar
    Join Date
    Jul 2017
    Location
    Thailand
    Posts
    445

    Question How to center the icons at the column header & the subitems?

    VBCCR14.OCX v1.4.0.56
    Control: ListView in Report mode

    Does anyone know how to center the icons at the column header and the subitems?

    Name:  Screenshot - 07.10.2017 , 09_21_18.png
Views: 1416
Size:  5.5 KB

  18. #1818
    Hyperactive Member
    Join Date
    Feb 2014
    Posts
    278

    Re: CommonControls (Replacement of the MS common controls)

    Code:
        ListView1.ColumnHeaders.Add , , "Name", 2000, LvwColumnHeaderAlignmentLeft
        ListView1.ColumnHeaders.Add , , "Symbol", 1200, LvwColumnHeaderAlignmentCenter
        ListView1.ColumnHeaders.Add , , "Anything", 1200, LvwColumnHeaderAlignmentRight
    or

    Code:
        ListView1.ColumnHeaders(2).Alignment = LvwColumnHeaderAlignmentCenter

  19. #1819
    New Member
    Join Date
    Dec 2015
    Posts
    2

    Re: CommonControls (Replacement of the MS common controls)

    is there a tool ,can be used to upgrade or migrate VB common Controls sp6 to CCRP v 1.4 ???
    had any one ade or used a tool like this , speciall for ToolBar and ImageList ... ??
    if yes please guide me or provie me a link to such tool

  20. #1820

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,374

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Karl77 View Post
    PAGER PROBLEMS

    There are 3 Pagers.

    Pager1 (red) is vertical.
    Buddycontrol is Picture1, set at design time.

    Pager2 (blue) is horizontal.
    Buddycontrol is Picture2, set at design time.

    Pager3 (lila) is horizontal.
    Buddycontrol is Toolbar1, set at design time.

    a)
    When I start, only Pager3 catches the Buddy correct.
    To assign the Buddies in Form:Load doesn't help.
    When the Form is loaded, the CommandButton works to do it.

    b)
    Now let's resize the form manually.
    Watch the Pager Buttons.
    The Pager shows it's Button wrong.
    It doesn't refer to the contained window size.
    Also when we resize back and forth, this Button shows up at different window sizes.


    ---

    With a toolbar as the contained window, it works ok.

    Do I do something wrong, or is a PictureBox not suitable for a Pager?
    There is indeed a specialty with the PictureBox control.
    It seems that the PictureBox will be re-sized by the Pager control. Also the issue with not able to set at design-time or at Form_Load is strange.
    For example setting a FrameW control (pure VB.UserControl only) works without issues.

    However, with following workaround you get the PictureBox behavior also correct:

    Code:
    Private Sub Form_Load()
    ' Preserve dimensions as the PictureBox will be re-sized by Pager control due to unknown reasons..
    H1 = Picture1.Height + (Pager1.BorderWidth * 2)
    W1 = Picture2.Width + (Pager2.BorderWidth * 2)
    
    End Sub
    Don't let the Pager control calculate the sizes automatically, adjust to preserved dimensions accordingly.
    Code:
    Private Sub Pager1_CalcSize(Width As Single, Height As Single)
    Height = H1
    End Sub
    
    Private Sub Pager2_CalcSize(Width As Single, Height As Single)
    Width = W1
    End Sub

  21. #1821
    Fanatic Member
    Join Date
    Apr 2015
    Posts
    524

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Krool View Post
    There is indeed a specialty with the PictureBox control.
    It seems that the PictureBox will be re-sized by the Pager control. Also the issue with not able to set at design-time or at Form_Load is strange.
    For example setting a FrameW control (pure VB.UserControl only) works without issues.
    I wondered why my PictureBox size changes magically as well.
    Of course I investigated my code first...

    Ok, this workaround will work.
    In my case the PictureBox size is quite dynamic, and I need to set and get the size often.
    This workaround is too cumbersome for me.

    I will use FrameW with BorderStyle = 0.
    (Just found out that 0 doesn't draw frame and caption).

    Solved so far, thank you.
    Last edited by Karl77; Oct 9th, 2017 at 09:18 AM.

  22. #1822
    Hyperactive Member Mith's Avatar
    Join Date
    Jul 2017
    Location
    Thailand
    Posts
    445

    Question Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by chosk View Post
    Code:
        ListView1.ColumnHeaders.Add , , "Name", 2000, LvwColumnHeaderAlignmentLeft
        ListView1.ColumnHeaders.Add , , "Symbol", 1200, LvwColumnHeaderAlignmentCenter
        ListView1.ColumnHeaders.Add , , "Anything", 1200, LvwColumnHeaderAlignmentRight
    or

    Code:
        ListView1.ColumnHeaders(2).Alignment = LvwColumnHeaderAlignmentCenter
    I tried this code but is doesnt center the icons at the columnheader and the subitem.

    Columnheader:

    Adding one space char at the text property of the columnheader fixed the problem and the columnheader icon gets centered with the text (" ").

    Subitem:

    I also added a space char to the text property of the subitem but the icon of the subitems is still left-aligned...

    Name:  Screenshot - 09.10.2017 , 16_48_14.png
Views: 1306
Size:  3.8 KB

    Maybe krool can check if this is a bug inside his code or a MS-related problem...
    Last edited by Mith; Oct 9th, 2017 at 04:53 AM. Reason: attached pic was not showed at the msg

  23. #1823
    Hyperactive Member Mith's Avatar
    Join Date
    Jul 2017
    Location
    Thailand
    Posts
    445

    Question RichTextBox font display problem

    hi krool,

    i loaded two different files with unicode text into the RichTextBox and the font always was changed automatically at a specific line.

    Here at the 3. line:

    Name:  Screenshot - 11.10.2017 , 07_25_53.png
Views: 1301
Size:  5.2 KB
    Download: folders2.txt

    and here at the 7. line:

    Name:  Screenshot - 11.10.2017 , 07_25_34.png
Views: 1281
Size:  4.6 KB
    Download: log 2.txt

    Code:
    rtfTest.LoadFile sFile$, RtfLoadSaveFormatUnicodeText
    After loading the unicode files i had set the font again but it doesnt changed the font display at the RichTextBox...any hints whats going here?

  24. #1824
    PowerPoster
    Join Date
    Jun 2015
    Posts
    2,224

    Re: CommonControls (Replacement of the MS common controls)

    the control automatically jumps to font substitution as soon as you get to a character not available in the original font.
    try using a font that has those characters already.

  25. #1825
    Frenzied Member
    Join Date
    Jan 2010
    Posts
    1,103

    Re: CommonControls (Replacement of the MS common controls)

    ListBoxW etc. is lack of DataMember, DataSource, DataFeild,DataFormat properties... Can you implement those like VBFlexGrid?

  26. #1826
    Hyperactive Member Mith's Avatar
    Join Date
    Jul 2017
    Location
    Thailand
    Posts
    445

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by DEXWERX View Post
    the control automatically jumps to font substitution as soon as you get to a character not available in the original font.
    try using a font that has those characters already.
    Thank you very much for that hint!

    Setting the font of the RichTextBox to "Arial Unicode MS" fixed the problem!

  27. #1827

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,374

    Re: CommonControls (Replacement of the MS common controls)

    Update released.

    Certain tweaks done in order to run better in the VBA environment.
    In theory those tweaks only would effect the OCX version. However, to be in sync the Std-EXE version got tweaked as well.
    There is no actual difference for VB6 IDE. It works like before.

    But for new VBCCR14.OCX (rev 61 onwards) and for future VBCCR15.OCX the support for the VBA IDE is better.
    Certainly newer Office version (e.g. 2010) is not so "sensitive" as older Office version (e.g. XP, 2002) for crashes.
    However, all tests are done in Office 2002 to be reliable.

    Also the "Cannot call friend function on object which is not an instance of defining class" error for the class collection objects is fixed. (VBA only)

    In order to replace to new version of the OCX it is strongly recommended to delete certain cache files for MS Office:

    Code:
    C:\Users\<username>\AppData\Local\Temp\VBE\VBCCR14.exd
    Code:
    C:\Users\<username>\Application Data\Microsoft\Forms\VBCCR14.exd
    Those cache files do only exist when previously loaded VBCCR14 into the toolbox on a UserForm.

    Then replace the new VBCCR14.OCX in the system directory.

  28. #1828

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,374

    Re: CommonControls (Replacement of the MS common controls)

    Update released.

    Again some further tweaks to run better in the VBA environment.
    There might be some pitfalls left. (e.g. StatusBar is known to still makes some troubles)

    However, as described in previous post the cache files should be deleted (again) when attempting to replace the OCX.

  29. #1829
    Fanatic Member
    Join Date
    Apr 2015
    Location
    Finland
    Posts
    679

    Re: CommonControls (Replacement of the MS common controls)

    Tested newest version, ListView downward dragging bug still exists.

    http://www.vbforums.com/showthread.p...=1#post5087103

    Also with MultiSelect=True, dragging moves only item under mouse cursor.

    and...
    Code:
    LvwListItem.ListSubItems.Add objSub.Index, objSub.Key, objSub.Text, objSub.ReportIcon, objSub.ToolTipText
    Wrong number of parameters -> missing tooltip parameter.

    https://msdn.microsoft.com/en-us/lib...(v=vs.60).aspx
    Last edited by Tech99; Oct 26th, 2017 at 10:54 PM.

  30. #1830

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,374

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Tech99 View Post
    Tested newest version, ListView downward dragging bug still exists.

    http://www.vbforums.com/showthread.p...=1#post5087103

    Also with MultiSelect=True, dragging moves only item under mouse cursor.

    and...
    Code:
    LvwListItem.ListSubItems.Add objSub.Index, objSub.Key, objSub.Text, objSub.ReportIcon, objSub.ToolTipText
    Wrong number of parameters -> missing tooltip parameter.

    https://msdn.microsoft.com/en-us/lib...(v=vs.60).aspx
    Update released.

    Thanks for the hint of missing 'ToolTipText' parameter in .ListSubItems.Add in the ListView control.
    Also good that this has been fixed now before the release of VBCCR15. (VBCCR14 can not be fixed in this regard due to binary compatibility)

    Concerning the downward dragging. This might not be a bug, rather a feature when 'SnapToGrid' property is True.

  31. #1831
    Addicted Member
    Join Date
    Jul 2017
    Posts
    233

    Re: CommonControls (Replacement of the MS common controls)

    Hi all ,
    I need to use the latest features for the ocx , but as Krool stated , he will release version 5 later this year or the next one . I tried to build a new activex control project and attach the controls and all common elements to it but it is difficult for me to set instances for class modules . I tried to open the STDexe project and change its type to activex control project after removing all forms and setting all user controls to public but did not work too . I think this is something related to conditional compiling . I need an activex control project holding the controls to be able to compile them to the ocx version or use the project itself in a group project without compliling . How can I do this ? and what I am missing here ? krool .

  32. #1832
    Addicted Member
    Join Date
    May 2011
    Posts
    230

    Re: CommonControls (Replacement of the MS common controls)

    I see no problem in what you're trying to achieve but make sure you changed the CLSID of the project AND the output filename of the OCX to avoid compatibility issue. if someone make a commercial product out of krool ocx and on the same computer the client is using your product, one of the program (eitheir the commercial product or yours) won't load...

    EDIT: in the first few post, KROOL made the exact same warning about this.

  33. #1833
    Addicted Member
    Join Date
    Jul 2017
    Posts
    233

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by VbNetMatrix View Post
    I see no problem in what you're trying to achieve but make sure you changed the CLSID of the project AND the output filename of the OCX to avoid compatibility issue. if someone make a commercial product out of krool ocx and on the same computer the client is using your product, one of the program (eitheir the commercial product or yours) won't load...

    EDIT: in the first few post, KROOL made the exact same warning about this.
    Thanks ,vbnet . Regardless of the point of compatibility , the program raises errors after changing its type to Activex control .

    here is what I have done :

    1- I opened the STDexe project
    2- removed all forms
    3- changed its type to activex control project
    4- A message appears " the project (start mode) property has changed "
    5- set all user controls to public
    6- set the "IsubClass" class module instances to global multiuse .
    7- removed the line which loads the main form from Sub_main()
    8- tried to compile to ocx , then error is raised as the next picture implies
    Name:  xxxxxxxx.jpg
Views: 952
Size:  28.6 KB

    what is missed here?

  34. #1834

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,374

    Re: CommonControls (Replacement of the MS common controls)

    Hosam, I will soon release VBCCR15.OCX for sure.
    So I suggest you wait a little bit further.

    The point is I want to ensure VBA works pretty good from the beginning of VBCCR15.
    I am almost done. 2 updates already released for VBA improvement. But a 3 (final one) is needed.

    So again, please little patience.

  35. #1835
    Addicted Member
    Join Date
    Jul 2017
    Posts
    233

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Krool View Post
    Hosam, I will soon release VBCCR15.OCX for sure.
    So I suggest you wait a little bit further.

    The point is I want to ensure VBA works pretty good from the beginning of VBCCR15.
    I am almost done. 2 updates already released for VBA improvement. But a 3 (final one) is needed.

    So again, please little patience.
    No offense krool , take your time . I am not hustling you at all . I know it is a headache developing such GIANT project . But if you dont mind , I am still in need to solve this problem because I want to accomplish a base for my new project and I want to work on the level of user controls not the ocx or make it as a separate ocx maybe after some final customization . Also I want to solve it to add this problem to my too little knowledge . Thanks for your patience Krool.

  36. #1836
    Addicted Member
    Join Date
    May 2011
    Posts
    230

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Hosam AL Dein View Post
    Thanks ,vbnet . Regardless of the point of compatibility , the program raises errors after changing its type to Activex control .

    here is what I have done :

    1- I opened the STDexe project
    2- removed all forms
    3- changed its type to activex control project
    4- A message appears " the project (start mode) property has changed "
    5- set all user controls to public
    6- set the "IsubClass" class module instances to global multiuse .
    7- removed the line which loads the main form from Sub_main()
    8- tried to compile to ocx , then error is raised as the next picture implies
    Name:  xxxxxxxx.jpg
Views: 952
Size:  28.6 KB

    what is missed here?
    the image you provide is blurry and I cannot read it to see the error msg.
    it seem to do with the public enum wich cannot be passed at outside perogative (normal)

    however, did you tried to compare your change with the existing (previous version) ocx project ?

  37. #1837
    Addicted Member
    Join Date
    Jul 2017
    Posts
    233

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by VbNetMatrix View Post
    the image you provide is blurry and I cannot read it to see the error msg.
    it seem to do with the public enum wich cannot be passed at outside perogative (normal)

    however, did you tried to compare your change with the existing (previous version) ocx project ?
    I did not change anything in code . I think this is due to conditional compiling for enums variables which varies from one project type to another .

    If you or anyone here can make this and provide me with the proper steps I will be so grateful . I want to know how this is done to at least increase my knowledge .

  38. #1838
    Lively Member
    Join Date
    Oct 2016
    Posts
    108

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Hosam AL Dein View Post
    I did not change anything in code . I think this is due to conditional compiling for enums variables which varies from one project type to another .

    If you or anyone here can make this and provide me with the proper steps I will be so grateful . I want to know how this is done to at least increase my knowledge .
    I did a little tinkering for that it looks like you need to remove some of the code in the ComCtlsBase module, and put it in the ISubclass class module.
    krool has put this code I different locations in the ocx source code then in the exe, I am not sure why. Please enlighten us krool
    below is the code you should move, try it and report your results, so others can be helped

    Code:
    #If False Then
    Private OLEDropModeNone, OLEDropModeManual
    Private CCAppearanceFlat, CCAppearance3D
    Private CCBorderStyleNone, CCBorderStyleSingle, CCBorderStyleThin, CCBorderStyleSunken, CCBorderStyleRaised
    Private CCBackStyleTransparent, CCBackStyleOpaque
    Private CCLeftRightAlignmentLeft, CCLeftRightAlignmentRight
    Private CCVerticalAlignmentTop, CCVerticalAlignmentCenter, CCVerticalAlignmentBottom
    Private CCIMEModeNoControl, CCIMEModeOn, CCIMEModeOff, CCIMEModeDisable, CCIMEModeHiragana, CCIMEModeKatakana, CCIMEModeKatakanaHalf, CCIMEModeAlphaFull, CCIMEModeAlpha, CCIMEModeHangulFull, CCIMEModeHangul
    Private CCRightToLeftModeNoControl, CCRightToLeftModeVBAME, CCRightToLeftModeSystemLocale, CCRightToLeftModeUserLocale, CCRightToLeftModeOSLanguage
    #End If
    Public Enum OLEDropModeConstants
    OLEDropModeNone = vbOLEDropNone
    OLEDropModeManual = vbOLEDropManual
    End Enum
    Public Enum CCAppearanceConstants
    CCAppearanceFlat = 0
    CCAppearance3D = 1
    End Enum
    Public Enum CCBorderStyleConstants
    CCBorderStyleNone = 0
    CCBorderStyleSingle = 1
    CCBorderStyleThin = 2
    CCBorderStyleSunken = 3
    CCBorderStyleRaised = 4
    End Enum
    Public Enum CCBackStyleConstants
    CCBackStyleTransparent = 0
    CCBackStyleOpaque = 1
    End Enum
    Public Enum CCLeftRightAlignmentConstants
    CCLeftRightAlignmentLeft = 0
    CCLeftRightAlignmentRight = 1
    End Enum
    Public Enum CCVerticalAlignmentConstants
    CCVerticalAlignmentTop = 0
    CCVerticalAlignmentCenter = 1
    CCVerticalAlignmentBottom = 2
    End Enum
    Public Enum CCIMEModeConstants
    CCIMEModeNoControl = 0
    CCIMEModeOn = 1
    CCIMEModeOff = 2
    CCIMEModeDisable = 3
    CCIMEModeHiragana = 4
    CCIMEModeKatakana = 5
    CCIMEModeKatakanaHalf = 6
    CCIMEModeAlphaFull = 7
    CCIMEModeAlpha = 8
    CCIMEModeHangulFull = 9
    CCIMEModeHangul = 10
    End Enum
    Public Enum CCRightToLeftModeConstants
    CCRightToLeftModeNoControl = 0
    CCRightToLeftModeVBAME = 1
    CCRightToLeftModeSystemLocale = 2
    CCRightToLeftModeUserLocale = 3
    CCRightToLeftModeOSLanguage = 4
    End Enum
    Last edited by Semke; Nov 6th, 2017 at 10:51 AM.

  39. #1839

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,374

    Re: CommonControls (Replacement of the MS common controls)

    In addition to what Semke stated please remove the WM_STYLECHANGED handler on those controls that have a WindowProcUserControlDesignMode function in it. (Recommended)

    Also I put an IObjectSafety implementation on the controls. (Optional)

    And also the controls in the Property Pages are replaced to support Unicode at design time. (Optional)

    So in my case it is a little bit of work to migrate to OCX version. But of course you can skip the 2 last steps.
    The 1. step however you should consider. (WM_STYLECHANGED)

    And as side note I do also a little bit of cleanup in the OCX version. (e.g. VisualStyles.bas is reduced to what is necessary etc.)

  40. #1840
    Addicted Member
    Join Date
    Jul 2017
    Posts
    233

    Re: CommonControls (Replacement of the MS common controls)

    Thanks semke , I followed what you provided and it worked . An essential step to add to the previous ones is that I changed the instances for all class modules to "GlobalMultiuse" . I will summarize the steps here

    Steps for converting STDexe to Activex control project :


    1- Open the STDexe project
    2- Remove all forms
    3- Change the project type to Activex control project
    4- A message appears " the project (start mode) property has changed "
    5- Set all user controls to public
    6- Set all class modules instances to GlobalMultiuse .
    7- Remove the line which loads the main form from Sub_main()
    8-Remove this code from ComCtlsBase module, and put it in the ISubclass class module

    Code:
    #If False Then
    Private OLEDropModeNone, OLEDropModeManual
    Private CCAppearanceFlat, CCAppearance3D
    Private CCBorderStyleNone, CCBorderStyleSingle, CCBorderStyleThin, CCBorderStyleSunken, CCBorderStyleRaised
    Private CCBackStyleTransparent, CCBackStyleOpaque
    Private CCLeftRightAlignmentLeft, CCLeftRightAlignmentRight
    Private CCVerticalAlignmentTop, CCVerticalAlignmentCenter, CCVerticalAlignmentBottom
    Private CCIMEModeNoControl, CCIMEModeOn, CCIMEModeOff, CCIMEModeDisable, CCIMEModeHiragana, CCIMEModeKatakana, CCIMEModeKatakanaHalf, CCIMEModeAlphaFull, CCIMEModeAlpha, CCIMEModeHangulFull, CCIMEModeHangul
    Private CCRightToLeftModeNoControl, CCRightToLeftModeVBAME, CCRightToLeftModeSystemLocale, CCRightToLeftModeUserLocale, CCRightToLeftModeOSLanguage
    #End If
    Public Enum OLEDropModeConstants
    OLEDropModeNone = vbOLEDropNone
    OLEDropModeManual = vbOLEDropManual
    End Enum
    Public Enum CCAppearanceConstants
    CCAppearanceFlat = 0
    CCAppearance3D = 1
    End Enum
    Public Enum CCBorderStyleConstants
    CCBorderStyleNone = 0
    CCBorderStyleSingle = 1
    CCBorderStyleThin = 2
    CCBorderStyleSunken = 3
    CCBorderStyleRaised = 4
    End Enum
    Public Enum CCBackStyleConstants
    CCBackStyleTransparent = 0
    CCBackStyleOpaque = 1
    End Enum
    Public Enum CCLeftRightAlignmentConstants
    CCLeftRightAlignmentLeft = 0
    CCLeftRightAlignmentRight = 1
    End Enum
    Public Enum CCVerticalAlignmentConstants
    CCVerticalAlignmentTop = 0
    CCVerticalAlignmentCenter = 1
    CCVerticalAlignmentBottom = 2
    End Enum
    Public Enum CCIMEModeConstants
    CCIMEModeNoControl = 0
    CCIMEModeOn = 1
    CCIMEModeOff = 2
    CCIMEModeDisable = 3
    CCIMEModeHiragana = 4
    CCIMEModeKatakana = 5
    CCIMEModeKatakanaHalf = 6
    CCIMEModeAlphaFull = 7
    CCIMEModeAlpha = 8
    CCIMEModeHangulFull = 9
    CCIMEModeHangul = 10
    End Enum
    Public Enum CCRightToLeftModeConstants
    CCRightToLeftModeNoControl = 0
    CCRightToLeftModeVBAME = 1
    CCRightToLeftModeSystemLocale = 2
    CCRightToLeftModeUserLocale = 3
    CCRightToLeftModeOSLanguage = 4
    End Enum
    These steps are open for any modification and addition by anyone who finds them incomplete or missing some points to be added or mentioned

    The previous steps are tested and the project works fine and I have not yet applied Krool`s steps . However , I am going to go on this advice and remove the exception until it is suitable time for krool to explain the reason for this step and the case which will raise a problem if these exceptions were not removed . Thanks all for help
    Last edited by Hosam AL Dein; Nov 7th, 2017 at 08:06 AM.

Page 46 of 94 FirstFirst ... 364344454647484956 ... LastLast

Posting Permissions

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



Click Here to Expand Forum to Full Width