# VBForums UtilityBank > UtilityBank - Components >  [VB6] ActiveX CommonControls (Replacement of the MS common controls)

## Krool

This is the ActiveX Control version that comes out of the Std-EXE version.

Current version: 1.7.46

The development state of the ActiveX Control version does not necessarily match to the Std-EXE version.
That comes because the Std-EXE version is the "leading source" and the ActiveX Control version is derived from the Std-EXE version after a certain time.
Reason why is that it is not practicable to release a new ActiveX Control after each new feature.
However, certain bugfixes can and will be implemented into the current ActiveX Control version. (Revision)

It is *not recommended* to use the source code to compile another binary.
If own modification is necessary please rename the library to avoid redundancies.
The source code of the project can also be viewed on GitHub.

Advantageous compared to the Std-EXE version is that all *property pages* support *Unicode*.

All controls are marked as "*Safe for Initialization and Scripting*" by the IObjectSafety interface.
In order to mark the CommonDialog class also "*Safe*" it is necessary to run the following .reg file:


```
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\CLSID\{068A3E97-D041-4248-AEEE-56B09D8D037C}\Implemented Categories]

[HKEY_CLASSES_ROOT\CLSID\{068A3E97-D041-4248-AEEE-56B09D8D037C}\Implemented Categories\{7DD95801-9882-11CF-9FA9-00AA006C42C4}]

[HKEY_CLASSES_ROOT\CLSID\{068A3E97-D041-4248-AEEE-56B09D8D037C}\Implemented Categories\{7DD95802-9882-11CF-9FA9-00AA006C42C4}]
```

Also everything is 100% *IDE-Safe*.

Here is a solution to use the VBCCR17.OCX Registration-Free. (Side-by-side)
Keep in mind that this technology needs at minimum Windows XP SP2 or Windows Server 2003.

*Tutorial:*
The "Development" machine needs to register the VBCCR17.OCX as usual and use the components for e.g. in a Std-EXE project.
The source project needs to include the Side-by-side resources. (see below)
Then on the "End user" machine you only need the VBCCR17.OCX and the .exe (Std-EXE project) on the same folder.
It will work then without any registration.

The source code of "VBCCR17SideBySide.res" is:



```
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
   <file name="VBCCR17.OCX">
      <typelib tlbid="{7020C36F-09FC-41FE-B822-CDE6FBB321EB}" version="1.0" flags="control" helpdir="" />
      <comClass clsid="{068A3E97-D041-4248-AEEE-56B09D8D037C}" tlbid="{7020C36F-09FC-41FE-B822-CDE6FBB321EB}" threadingModel="Apartment" progid="VBCCR17.CommonDialog" />
      <comClass clsid="{9602627B-40A9-4638-B4CD-39A365F85432}" tlbid="{7020C36F-09FC-41FE-B822-CDE6FBB321EB}" threadingModel="Apartment" progid="VBCCR17.Animation" />
      <comClass clsid="{C3853FC8-E7D9-43D4-88AA-4DF0651E66B1}" tlbid="{7020C36F-09FC-41FE-B822-CDE6FBB321EB}" threadingModel="Apartment" />
      <comClass clsid="{5F2AB905-9655-4A13-9F7E-433EDFF185F2}" tlbid="{7020C36F-09FC-41FE-B822-CDE6FBB321EB}" threadingModel="Apartment" progid="VBCCR17.CheckBoxW" />
      <comClass clsid="{14959488-6EF6-4323-A7CB-7165F32D8CC2}" tlbid="{7020C36F-09FC-41FE-B822-CDE6FBB321EB}" threadingModel="Apartment" progid="VBCCR17.ComboBoxW" />
      <comClass clsid="{A6C631D4-7449-44DC-9AD2-D86357554975}" tlbid="{7020C36F-09FC-41FE-B822-CDE6FBB321EB}" threadingModel="Apartment" progid="VBCCR17.CommandButtonW" />
      <comClass clsid="{5B07381D-39B9-40BF-9EE3-AF0636276897}" tlbid="{7020C36F-09FC-41FE-B822-CDE6FBB321EB}" threadingModel="Apartment" progid="VBCCR17.CommandLink" />
      <comClass clsid="{8AC46A3E-727E-48EC-A063-4FC42CB744F4}" tlbid="{7020C36F-09FC-41FE-B822-CDE6FBB321EB}" threadingModel="Apartment" />
      <comClass clsid="{03F663A5-EF57-4F73-BDAF-31C5E673B739}" tlbid="{7020C36F-09FC-41FE-B822-CDE6FBB321EB}" threadingModel="Apartment" progid="VBCCR17.CoolBar" />
      <comClass clsid="{1908EE8D-074B-4C73-A650-02BE9202D3A2}" tlbid="{7020C36F-09FC-41FE-B822-CDE6FBB321EB}" threadingModel="Apartment" />
      <comClass clsid="{4BFD0894-5927-4DF9-B65C-19632904D2BC}" tlbid="{7020C36F-09FC-41FE-B822-CDE6FBB321EB}" threadingModel="Apartment" />
      <comClass clsid="{ED9B663D-A5CA-4D5F-A35E-F337009BA0B9}" tlbid="{7020C36F-09FC-41FE-B822-CDE6FBB321EB}" threadingModel="Apartment" progid="VBCCR17.DTPicker" />
      <comClass clsid="{B73EA339-27D1-46CF-9FE9-D166C46248DD}" tlbid="{7020C36F-09FC-41FE-B822-CDE6FBB321EB}" threadingModel="Apartment" />
      <comClass clsid="{67E6130D-31EA-4462-8B7B-35C8D00B8878}" tlbid="{7020C36F-09FC-41FE-B822-CDE6FBB321EB}" threadingModel="Apartment" progid="VBCCR17.FontCombo" />
      <comClass clsid="{2FDC9106-3494-4747-8FB2-61D379DD0A82}" tlbid="{7020C36F-09FC-41FE-B822-CDE6FBB321EB}" threadingModel="Apartment" progid="VBCCR17.FrameW" />
      <comClass clsid="{3760E97F-F505-4A7E-A7B9-A5D4D475832E}" tlbid="{7020C36F-09FC-41FE-B822-CDE6FBB321EB}" threadingModel="Apartment" progid="VBCCR17.HotKey" />
      <comClass clsid="{277DDA80-4A98-4736-A23D-A1C200E791A6}" tlbid="{7020C36F-09FC-41FE-B822-CDE6FBB321EB}" threadingModel="Apartment" progid="VBCCR17.ImageCombo" />
      <comClass clsid="{04A8661E-B343-4EBC-AB7C-3910DFBE1B18}" tlbid="{7020C36F-09FC-41FE-B822-CDE6FBB321EB}" threadingModel="Apartment" />
      <comClass clsid="{6993750D-0041-47C0-BF0F-7F82F68949C1}" tlbid="{7020C36F-09FC-41FE-B822-CDE6FBB321EB}" threadingModel="Apartment" progid="VBCCR17.ImageList" />
      <comClass clsid="{6C56E631-FF75-42B2-B4B7-8B4031550584}" tlbid="{7020C36F-09FC-41FE-B822-CDE6FBB321EB}" threadingModel="Apartment" />
      <comClass clsid="{CB5DEA21-63B5-480B-BEFE-5EE5314722C5}" tlbid="{7020C36F-09FC-41FE-B822-CDE6FBB321EB}" threadingModel="Apartment" />
      <comClass clsid="{D717FCAC-DDEF-4CF3-BA30-FDEFC64C097B}" tlbid="{7020C36F-09FC-41FE-B822-CDE6FBB321EB}" threadingModel="Apartment" progid="VBCCR17.IPAddress" />
      <comClass clsid="{3F8EFA5D-6EE2-4243-B181-997284B86913}" tlbid="{7020C36F-09FC-41FE-B822-CDE6FBB321EB}" threadingModel="Apartment" />
      <comClass clsid="{E3C54ADB-EED1-4D03-9F7B-4D42EA7BFC7D}" tlbid="{7020C36F-09FC-41FE-B822-CDE6FBB321EB}" threadingModel="Apartment" progid="VBCCR17.LabelW" />
      <comClass clsid="{9F562C7A-EC4B-4E02-85D2-CE42203EC994}" tlbid="{7020C36F-09FC-41FE-B822-CDE6FBB321EB}" threadingModel="Apartment" progid="VBCCR17.LinkLabel" />
      <comClass clsid="{63904521-756C-4F8B-BFB8-4944B436C4BA}" tlbid="{7020C36F-09FC-41FE-B822-CDE6FBB321EB}" threadingModel="Apartment" />
      <comClass clsid="{3E22EA9C-D403-4C3B-B5DA-96DD4AC8EC93}" tlbid="{7020C36F-09FC-41FE-B822-CDE6FBB321EB}" threadingModel="Apartment" progid="VBCCR17.ListBoxW" />
      <comClass clsid="{172DFD6D-064E-4E31-9558-89096C3B2C07}" tlbid="{7020C36F-09FC-41FE-B822-CDE6FBB321EB}" threadingModel="Apartment" progid="VBCCR17.ListView" />
      <comClass clsid="{34FC2451-FF36-4A5C-953F-6C5C79A1700E}" tlbid="{7020C36F-09FC-41FE-B822-CDE6FBB321EB}" threadingModel="Apartment" />
      <comClass clsid="{0A1CF8E6-385A-4627-ABF7-87ADA3C542B0}" tlbid="{7020C36F-09FC-41FE-B822-CDE6FBB321EB}" threadingModel="Apartment" />
      <comClass clsid="{0EBECF21-3927-421A-B70E-138694D86EB2}" tlbid="{7020C36F-09FC-41FE-B822-CDE6FBB321EB}" threadingModel="Apartment" />
      <comClass clsid="{9AE1DA41-2B6E-495E-9403-69DB3C6B4D7A}" tlbid="{7020C36F-09FC-41FE-B822-CDE6FBB321EB}" threadingModel="Apartment" progid="VBCCR17.MCIWnd" />
      <comClass clsid="{45A07E72-1CBF-43BB-804D-816A071DF623}" tlbid="{7020C36F-09FC-41FE-B822-CDE6FBB321EB}" threadingModel="Apartment" progid="VBCCR17.MonthView" />
      <comClass clsid="{03DDF33B-3D29-4888-8EDC-70C02072CEEA}" tlbid="{7020C36F-09FC-41FE-B822-CDE6FBB321EB}" threadingModel="Apartment" />
      <comClass clsid="{E7C8AA1C-5D9D-4E69-AA90-B271F3CD418B}" tlbid="{7020C36F-09FC-41FE-B822-CDE6FBB321EB}" threadingModel="Apartment" progid="VBCCR17.OptionButtonW" />
      <comClass clsid="{8D5766F1-B256-46AF-8A55-4DEA235F71F1}" tlbid="{7020C36F-09FC-41FE-B822-CDE6FBB321EB}" threadingModel="Apartment" progid="VBCCR17.Pager" />
      <comClass clsid="{8F839938-51C3-4558-916F-E4ED967E88EC}" tlbid="{7020C36F-09FC-41FE-B822-CDE6FBB321EB}" threadingModel="Apartment" />
      <comClass clsid="{7331C00D-E101-4E1F-AE65-D56EB37263FD}" tlbid="{7020C36F-09FC-41FE-B822-CDE6FBB321EB}" threadingModel="Apartment" progid="VBCCR17.ProgressBar" />
      <comClass clsid="{479EC666-5FF8-43C8-A2E6-D53853D0138C}" tlbid="{7020C36F-09FC-41FE-B822-CDE6FBB321EB}" threadingModel="Apartment" />
      <comClass clsid="{71C2F1C5-7282-468B-9159-1BC4B7D3C90F}" tlbid="{7020C36F-09FC-41FE-B822-CDE6FBB321EB}" threadingModel="Apartment" progid="VBCCR17.RichTextBox" />
      <comClass clsid="{D8707683-3AB9-41E2-B923-B32F3449A288}" tlbid="{7020C36F-09FC-41FE-B822-CDE6FBB321EB}" threadingModel="Apartment" />
      <comClass clsid="{FE7B5DA6-4D26-41C1-B5E1-3FD2C26638CB}" tlbid="{7020C36F-09FC-41FE-B822-CDE6FBB321EB}" threadingModel="Apartment" progid="VBCCR17.Slider" />
      <comClass clsid="{515D25BE-D6CF-4C3E-96EE-79DBDA944B34}" tlbid="{7020C36F-09FC-41FE-B822-CDE6FBB321EB}" threadingModel="Apartment" />
      <comClass clsid="{A4822523-E1D8-4802-912F-6825CBCF7EA2}" tlbid="{7020C36F-09FC-41FE-B822-CDE6FBB321EB}" threadingModel="Apartment" />
      <comClass clsid="{BE90171C-60AC-404E-91CD-48C36B7EB5D0}" tlbid="{7020C36F-09FC-41FE-B822-CDE6FBB321EB}" threadingModel="Apartment" progid="VBCCR17.SpinBox" />
      <comClass clsid="{C5366161-D0E7-49F6-95F3-788BA9600617}" tlbid="{7020C36F-09FC-41FE-B822-CDE6FBB321EB}" threadingModel="Apartment" />
      <comClass clsid="{73DEDEDA-B899-4B59-883C-C8F66C2C7A9B}" tlbid="{7020C36F-09FC-41FE-B822-CDE6FBB321EB}" threadingModel="Apartment" progid="VBCCR17.StatusBar" />
      <comClass clsid="{560F8AC8-028D-4F88-BEEC-67FFEE357466}" tlbid="{7020C36F-09FC-41FE-B822-CDE6FBB321EB}" threadingModel="Apartment" />
      <comClass clsid="{7C2A3132-2779-4D2B-B687-052B994E0602}" tlbid="{7020C36F-09FC-41FE-B822-CDE6FBB321EB}" threadingModel="Apartment" />
      <comClass clsid="{FD6C1D42-591A-4D59-873B-3825E0F9A48F}" tlbid="{7020C36F-09FC-41FE-B822-CDE6FBB321EB}" threadingModel="Apartment" progid="VBCCR17.SysInfo" />
      <comClass clsid="{5A449BC4-90AA-47FA-B2B5-D8B555EF91EF}" tlbid="{7020C36F-09FC-41FE-B822-CDE6FBB321EB}" threadingModel="Apartment" progid="VBCCR17.TabStrip" />
      <comClass clsid="{00EC79F7-8382-4217-9943-3CC8A0B251A6}" tlbid="{7020C36F-09FC-41FE-B822-CDE6FBB321EB}" threadingModel="Apartment" />
      <comClass clsid="{269A7AD4-CFE9-4655-A070-C1D3CC1AE00F}" tlbid="{7020C36F-09FC-41FE-B822-CDE6FBB321EB}" threadingModel="Apartment" />
      <comClass clsid="{C08B5E24-A816-480C-A0D9-52173F420F3F}" tlbid="{7020C36F-09FC-41FE-B822-CDE6FBB321EB}" threadingModel="Apartment" progid="VBCCR17.TextBoxW" />
      <comClass clsid="{B700EB90-2F14-4776-969D-40726357016A}" tlbid="{7020C36F-09FC-41FE-B822-CDE6FBB321EB}" threadingModel="Apartment" />
      <comClass clsid="{BD34E876-94B4-4A0E-A9CC-CC64D0580F08}" tlbid="{7020C36F-09FC-41FE-B822-CDE6FBB321EB}" threadingModel="Apartment" progid="VBCCR17.ToolBar" />
      <comClass clsid="{E441BD93-5F11-492E-A22C-C3F36DC07716}" tlbid="{7020C36F-09FC-41FE-B822-CDE6FBB321EB}" threadingModel="Apartment" />
      <comClass clsid="{7476271E-C33F-4A1A-84ED-A4373AA7B9C6}" tlbid="{7020C36F-09FC-41FE-B822-CDE6FBB321EB}" threadingModel="Apartment" />
      <comClass clsid="{4A1E23DB-0330-4BF9-8CB1-8DED96FF0A72}" tlbid="{7020C36F-09FC-41FE-B822-CDE6FBB321EB}" threadingModel="Apartment" progid="VBCCR17.TreeView" />
      <comClass clsid="{B2B4454B-913E-40E4-8FE2-77B9BB082924}" tlbid="{7020C36F-09FC-41FE-B822-CDE6FBB321EB}" threadingModel="Apartment" />
      <comClass clsid="{9C41E0AA-3074-497D-A552-FD9E2720AA36}" tlbid="{7020C36F-09FC-41FE-B822-CDE6FBB321EB}" threadingModel="Apartment" progid="VBCCR17.UpDown" />
      <comClass clsid="{5AFF51F6-4021-4B90-82D3-F59A5F34CCB6}" tlbid="{7020C36F-09FC-41FE-B822-CDE6FBB321EB}" threadingModel="Apartment" />
      <comClass clsid="{2FA19598-CAE7-4257-8892-6EE4DA1158E8}" tlbid="{7020C36F-09FC-41FE-B822-CDE6FBB321EB}" threadingModel="Apartment" progid="VBCCR17.VirtualCombo" />
      <comClass clsid="{F1457E04-22FC-4D37-B4C1-E5126DF9DBDC}" tlbid="{7020C36F-09FC-41FE-B822-CDE6FBB321EB}" threadingModel="Apartment" progid="VBCCR17.VListBox" />
   </file>
</assembly>
```

The attached file VBCCR17.OCX.rar.*zip* should be renamed to VBCCR17.OCX.rar after download and it contains the pre-compiled OCX.
The attached file VBCCR17.zip contains the source code.

----------


## Carlos Rocha

Thank you very much  :Smilie:

----------


## Semke

Thank you very much

----------


## Darkbob

Hey guys - thanks for the great work.  I'm having a problem though.  First off the demo app crashes VB6 when I load the main form.

I made a new form and added controls to it one by one.  I ran into a snag when I added the Link Label control.  I get "The Linklabel control requires at least version 6.0 of comctl32.dll.  in order to use it, you have to define a manifest file for your application.  For using the control in the VB6 IDE, define a manifest file for VB6".

The command Link control says almost exactly the same thing except it says i need version 6.1 of comctl32.dll

Any idea where a guy can get comctl32?  Any idea where I could get a manifest file for VB6 (or what that means?)

----------


## Krool

> Hey guys - thanks for the great work.  I'm having a problem though.  First off the demo app crashes VB6 when I load the main form.
> 
> I made a new form and added controls to it one by one.  I ran into a snag when I added the Link Label control.  I get "The Linklabel control requires at least version 6.0 of comctl32.dll.  in order to use it, you have to define a manifest file for your application.  For using the control in the VB6 IDE, define a manifest file for VB6".
> 
> The command Link control says almost exactly the same thing except it says i need version 6.1 of comctl32.dll
> 
> Any idea where a guy can get comctl32?  Any idea where I could get a manifest file for VB6 (or what that means?)


The comctl32 is already there. A manifest file just says which version you want to use.
Follow the instructions here to enable the IDE for using the 6.x comctl32. And add the VBCCR14SideBySideAndVisualStyles.res to your app to enable your compiled .exe to use the 6.x comctl32.

----------


## Darkbob

Thanks for the reply.  I did follow the instructions and made a new VB6.EXE file.  Added all the indicated resource files - all 3 listed above - and put the new EXE in the proper folder, replaced the existing VB6.EXE, rebooted and re-ran the demo project.  

Similar error followed by the IDE crashing.  

The error is happening because ComCtlsSupportLevel() returns a zero.  The source code responds with an error message saying

"To use this functionality, you must provide a manifest specifying comctl32.dll version 6.0 or higher."

Sad that such an amazing project and the demo just doesn't work at all.

----------


## Darkbob

Pretty impressive work!  I've managed to use the OCX file.  No luck with any of the side by side stuff.  I'm just lost in that area.  And the demo crashes and locks up VB.  So that doesn't exactly instill confidence.  But other than that, it's quite the project.  Thanks!

----------


## nisharamj

Thanks for the project. This is really helpful. But I have a problem when I am trying to use this ActiveX CommonControls with my project to support Unicode. But it works only with developing machine. When I tried to run the project in another computer after registering the VBCCR14.OCX, it gives me a error message "Error in loading DLL". Could you please tell me how do I solve this issue?

----------


## softv

First and foremost, thanks a ton to Krool for this wonderful effort. This is absolutely marvelous and it is pretty exciting to go through the various aspects of this project (Replacement of the MS common controls). Though I am interested in all the controls, as of now, my primary interest is on the RichTexBox. So, I started experimenting with it and I encountered some problems. 

I am listing the problems below along with a code snippet to illustrate the problems. Please note that I am new to this forum and this is the first time I am writing here. So, in case I have not followed any protocols related to posting, kindly bear with me and please do guide me for later posts. Also, in case I have understood things completely wrongly about one or more aspects of either the RichTextBox control of this project or of this project itself and that is the reason for me facing the following problems, then kindly correct my understanding and kindly guide me as to what to do to set right the following problems.

Problems:
1. When I set some string (e.g. "a") for a RichTexBox control (say, named 'rtb1') and then compare the text with the same string (i.e. if rtb1.text = "a"), the comparison does not return true. Also, adding some string to the end of 'rtb1' results in characters not present in the string getting added (and displayed). I found that space in the original string was always getting replaced by a character whose Unicode value was U2000 (Decimal - 8192). Same with other characters, as far as I observed. A specific character (say 'a') was always getting replaced by one other specific character. 

2. 'Len' and 'Instr' consider "VbCrLf"s fully whereas 'SelStart' and 'Find' ignore the Lf in "VbCrLf"s. Because of this, inconsistencies arise. 

The code below illustrates what happens because of the above two problems. It needs a Form with a CommandButton (Command1) and a RichTextBox (named 'rtb1')


```
Private Sub Command1_Click()
  
  Dim s As String
  
  s = " a " & vbCrLf & vbCrLf & " ab"
  
  rtb1.Text = s
  If rtb1.Text = s Then
    MsgBox "yes"
  End If
  
  MsgBox "Length = " & Len(rtb1.Text) '10 is displayed
  rtb1.SelStart = Len(rtb1.Text)
  MsgBox "Selstart = " & rtb1.SelStart '8 is displayed
    
  MsgBox "Instr b = " & InStr(rtb1.Text, "b") '10 is displayed
  MsgBox "Find b = " & rtb1.Find("b") '7 is displayed
  
  rtb1.Text = rtb1.Text & s 'characters not present in string 's' get added (and displayed)
                            
End Sub
```

Note-1: 
After working on "problem 1" for around 6 hours -  to find its cause and a possible solution, I finally set right the problem at my end by introducing a line of code in the following function of 'RichTextBox.ctl'.


```
Private Function StreamStringOut(ByRef Value As String, ByVal Flags As Long) As Long.
```

I added the following line 


```
value = left$(value, len(value))
```

after the line 


```
Value = RtfStreamStringOut()
```

in the aforesaid 'StreamStringOut' function.

I am not at all suggesting that the inclusion of the above line of code is the right thing to do. I am just mentioning what I did so that it can serve as a tip to Krool or any other member to find out the right thing to be done, eventually. 

Note-2:
As of now, I do need VbCrLf in my programs. So, I would be happy if the eventual solution does consider VbCrLf fully so that it is consistent with the behavior of the normal RichTextBox (RICHTX32.OCX component, I mean). 

Note-3:
I have tested with the latest version of the ocx control (1.4.11). My system is Windows 7, 64-bit.

A few queries now:
1. The links in the RichTextBox are not clickable. I have to set some property on or off to make them clickable? If so, what is that property? If not, is anything planned for making the links clickable in future?
2. The normal RichTextBox wraps text around even if horizontal scroll bar is set. The RichTextBox of this project wraps text around only when the horizontal scroll bar is not set. Can the RichTextBox of this project also made to wrap text around even if horizontal scroll bar is set?

Thanks.

----------


## markshuff

Should this control work with VBA.  I added a reference in Access, but when I try to add a control to a form, Access crashes.

----------


## MountainMan

Krool, the updated OCX file did not get attached to post #1...

----------


## fixxxer

Hi there Krool, 

first of all thank you for your effort in this project. This is indeed a wonderful replacement for the old and buggy MS Common controls. 

I use the MS Common Controls in various projects in MS access and I tried adding a reference in Access but it crashed as soon as I added a control. Is there a way to make your controls work in VBA?
Thanks in adavance

BR

----------


## Krool

> first of all thank you for your effort in this project. This is indeed a wonderful replacement for the old and buggy MS Common controls. 
> 
> I use the MS Common Controls in various projects in MS access and I tried adding a reference in Access but it crashed as soon as I added a control. Is there a way to make your controls work in VBA?


VBA was not my top priority. I know that most of the controls don't work and others do. For example ImageList control does work.
However, I will begin testings soon to enable better VBA support.

----------


## MountainMan

> Hi there Krool, 
> 
> I use the MS Common Controls in various projects in MS access and I tried adding a reference in Access but it crashed as soon as I added a control. Is there a way to make your controls work in VBA?
> Thanks in adavance
> 
> BR


I wonder if you have specified a reference to oleguids.tlb? It shows up in the References list as "OLE Guid and interface definitions" and I don't think it is discussed in this thread but it is included in the zip file (actually it is in the OLEGuids sub-folder of a VBCCR14.zip that is a zip within the larger zip). Every time Krool issues an update, I go to an elevated CMD prompt and I copy that file to C:\Windows\SysWOW64 to ensure that I always have the latest one available for my VB6 and VBA programs and then I go to References in either VB6 or VBA programs and it is always where it should be, whatever the latest version may be.

I just made a new file in Excel 2010 and was able to bring in all of Krool's controls without crashing. He needs to do some work because for almost all of them only a few options show up for each. I don't use Access but my guess is that you need to reference oleguids.tlb.

Krool, you probably should highlight the need to do that in this thread. You do it in the non-OCX thread but I think you need to make a larger reference to its need in this thread.

----------


## Krool

For the compiled OCX is no reference needed to OLEGuids.tlb.

----------


## Krool

Update, the OCX now works better in the VBA environment.

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



```
C:\Users\<username>\AppData\Local\Temp\VBE\VBCCR14.exd
```



```
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.

----------


## Krool

Again update so the OCX version works better in the VBA environment.

There might be some pitfalls left (e.g. StatusBar still makes some trouble) but this update does improve the VBA compatibility a big step further.

The cache files should be deleted again when attempting to replace. (see previous post)

----------


## hymced

Hi all and Krool

I have just attempted using it in VBA environment (VBA7 under Excel 2016 32-bit on Windows 10 64-bit)

I can't get some features to work with the ListView, the following has no effect :



```
With UserForm1.ListView1

.VisualStyles = True
.VisualTheme = LvwVisualThemeExplorer
.HighlightColumnHeaders = True
.UseColumnChevron = True

End With
```

Is it normal for now ?

----------


## Krool

> Hi all and Krool
> 
> I have just attempted using it in VBA environment (VBA7 under Excel 2016 32-bit on Windows 10 64-bit)
> 
> I can't get some features to work with the ListView, the following has no effect :
> 
> 
> 
> ```
> ...


VBA IDE is not themed. Thus comctl32.dll version 5.8x is used. So yes, it is normal that your code has no effect.

----------


## Krool

Update released to version 1.5.

Please note that due to the increased size the .zip archive was no longer sufficient. (> 2 MB)
That's why I had to switch to the .rar archive. As always the .docx extension was added to circumvent the 500 KB upload limit. So remove .docx first.

----------


## lrd_VB6

Hello,

Here is the update of my converter for the latest version of VBCCRxx (15).
Translates sources using VBCCR 11 to 14 for version 15.
All converted files are saved (.bak) as a precaution. :Thumb: 

When you have a project of 10000 lines, it's handy! :Smilie: 

Good work

----------


## OldClock

As with the Std-EXE version, installation instructions are missing.

I downloaded and registered the OCX.




> Keep in mind that this technology needs at minimum Windows XP SP2 or Windows Server 2003


Does the Std-EXE version need minimum Windows XP SP2?




> The source project needs to include the Side-by-side resources.


Include how? Do I just store this in the source code folder (if so, relative to what?), or do I need to register this somehow (if so, how)?

There is something odd with both of the VBCCR15SideBySide*.res attachments. Your code sample under "The source code of "VBCCR15SideBySide.res" is:" contains only plain text, while the downloaded .res files both have this header:


```
00000000  00 00 00 00 20 00 00 00  ff ff 00 00 ff ff 00 00  |.... ...........|
00000010  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000020  7f 25 00 00 20 00 00 00  ff ff 18 00 ff ff 01 00  |.%.. ...........|
00000030  00 00 00 00 30 10 09 04  00 00 00 00 00 00 00 00  |....0...........|
00000040  3c 3f 78 6d 6c 20 76 65  72 73 69 6f 6e 3d 22 31  |<?xml version="1|
```

How does one use these new widgets in an existing project?
I tried copying the "VBCCR15" folder into my repo and adding this into my existing VBP file, but there were plenty of errors when I tried to run:


```
Class=CbrBand; VBCCR15\Builds\CoolBar\CbrBand.cls
Class=CbrBandProperties; VBCCR15\Builds\CoolBar\CbrBandProperties.cls
Class=CbrBands; VBCCR15\Builds\CoolBar\CbrBands.cls
Class=CommonDialog; VBCCR15\Builds\CommonDialog.cls
Class=Enumeration; VBCCR15\Builds\Enumeration.cls
Class=ISubclass; VBCCR15\Builds\ISubclass.cls
Class=ImcComboItem; VBCCR15\Builds\ImageCombo\ImcComboItem.cls
Class=ImcComboItems; VBCCR15\Builds\ImageCombo\ImcComboItems.cls
Class=ImlListImage; VBCCR15\Builds\ImageList\ImlListImage.cls
Class=ImlListImages; VBCCR15\Builds\ImageList\ImlListImages.cls
Class=LlbLink; VBCCR15\Builds\LinkLabel\LlbLink.cls
Class=LlbLinks; VBCCR15\Builds\LinkLabel\LlbLinks.cls
Class=LvwColumnHeader; VBCCR15\Builds\ListView\LvwColumnHeader.cls
Class=LvwColumnHeaders; VBCCR15\Builds\ListView\LvwColumnHeaders.cls
Class=LvwGroup; VBCCR15\Builds\ListView\LvwGroup.cls
Class=LvwGroups; VBCCR15\Builds\ListView\LvwGroups.cls
Class=LvwListItem; VBCCR15\Builds\ListView\LvwListItem.cls
Class=LvwListItems; VBCCR15\Builds\ListView\LvwListItems.cls
Class=LvwListSubItem; VBCCR15\Builds\ListView\LvwListSubItem.cls
Class=LvwListSubItems; VBCCR15\Builds\ListView\LvwListSubItems.cls
Class=RtfOleCallback; VBCCR15\Builds\RichTextBox\RtfOleCallback.cls
Class=SbrPanel; VBCCR15\Builds\StatusBar\SbrPanel.cls
Class=SbrPanelProperties; VBCCR15\Builds\StatusBar\SbrPanelProperties.cls
Class=SbrPanels; VBCCR15\Builds\StatusBar\SbrPanels.cls
Class=TbrButton; VBCCR15\Builds\ToolBar\TbrButton.cls
Class=TbrButtonMenu; VBCCR15\Builds\ToolBar\TbrButtonMenu.cls
Class=TbrButtonMenus; VBCCR15\Builds\ToolBar\TbrButtonMenus.cls
Class=TbrButtonProperties; VBCCR15\Builds\ToolBar\TbrButtonProperties.cls
Class=TbrButtons; VBCCR15\Builds\ToolBar\TbrButtons.cls
Class=TbsTab; VBCCR15\Builds\TabStrip\TbsTab.cls
Class=TbsTabs; VBCCR15\Builds\TabStrip\TbsTabs.cls
Class=TvwNode; VBCCR15\Builds\TreeView\TvwNode.cls
Class=TvwNodes; VBCCR15\Builds\TreeView\TvwNodes.cls
Class=VTableSubclass; VBCCR15\Builds\VTableSubclass.cls
Module=ComCtlsBase; VBCCR15\Builds\ComCtlsBase.bas
Module=Common; VBCCR15\Common\Common.bas
Module=RichTextBoxBase; VBCCR15\Builds\RichTextBox\RichTextBoxBase.bas
Module=VTableHandle; VBCCR15\Builds\VTableHandle.bas
Module=VisualStyles; VBCCR15\Common\VisualStyles.bas
PropertyPage=VBCCR15\Builds\Animation\PPAnimationGeneral.pag
PropertyPage=VBCCR15\Builds\CommandLink\PPCommandLinkGeneral.pag
PropertyPage=VBCCR15\Builds\CoolBar\PPCoolBarBands.pag
PropertyPage=VBCCR15\Builds\CoolBar\PPCoolBarGeneral.pag
PropertyPage=VBCCR15\Builds\DTPicker\PPDTPickerGeneral.pag
PropertyPage=VBCCR15\Builds\ImageCombo\PPImageComboGeneral.pag
PropertyPage=VBCCR15\Builds\ImageList\PPImageListGeneral.pag
PropertyPage=VBCCR15\Builds\ImageList\PPImageListImages.pag
PropertyPage=VBCCR15\Builds\LinkLabel\PPLinkLabelGeneral.pag
PropertyPage=VBCCR15\Builds\ListView\PPListViewGeneral.pag
PropertyPage=VBCCR15\Builds\ListView\PPListViewImageLists.pag
PropertyPage=VBCCR15\Builds\ListView\PPListViewSorting.pag
PropertyPage=VBCCR15\Builds\MonthView\PPMonthViewGeneral.pag
PropertyPage=VBCCR15\Builds\Pager\PPPagerGeneral.pag
PropertyPage=VBCCR15\Builds\ProgressBar\PPProgressBarGeneral.pag
PropertyPage=VBCCR15\Builds\RichTextBox\PPRichTextBoxGeneral.pag
PropertyPage=VBCCR15\Builds\Slider\PPSliderAppearance.pag
PropertyPage=VBCCR15\Builds\Slider\PPSliderGeneral.pag
PropertyPage=VBCCR15\Builds\SpinBox\PPSpinBoxGeneral.pag
PropertyPage=VBCCR15\Builds\StatusBar\PPStatusBarGeneral.pag
PropertyPage=VBCCR15\Builds\StatusBar\PPStatusBarPanels.pag
PropertyPage=VBCCR15\Builds\TabStrip\PPTabStripGeneral.pag
PropertyPage=VBCCR15\Builds\TabStrip\PPTabStripTabs.pag
PropertyPage=VBCCR15\Builds\TextBoxW\PPTextBoxWText.pag
PropertyPage=VBCCR15\Builds\ToolBar\PPToolBarButtons.pag
PropertyPage=VBCCR15\Builds\ToolBar\PPToolBarGeneral.pag
PropertyPage=VBCCR15\Builds\TreeView\PPTreeViewGeneral.pag
PropertyPage=VBCCR15\Builds\UpDown\PPUpDownGeneral.pag
Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#C:\WINDOWS\System32\stdole2.tlb#OLE Automation
Reference=*\G{5A2B9220-BF07-11E6-9598-0800200C9A66}#1.0#0#C:\WINDOWS\system32\OLEGuids.tlb#OLE Guid and interface definitions
UserControl=VBCCR15\Builds\Animation\Animation.ctl
UserControl=VBCCR15\Builds\CheckBoxW\CheckBoxW.ctl
UserControl=VBCCR15\Builds\ComboBoxW\ComboBoxW.ctl
UserControl=VBCCR15\Builds\CommandButtonW\CommandButtonW.ctl
UserControl=VBCCR15\Builds\CommandLink\CommandLink.ctl
UserControl=VBCCR15\Builds\CoolBar\CoolBar.ctl
UserControl=VBCCR15\Builds\DTPicker\DTPicker.ctl
UserControl=VBCCR15\Builds\FrameW\FrameW.ctl
UserControl=VBCCR15\Builds\HotKey\HotKey.ctl
UserControl=VBCCR15\Builds\IPAddress\IPAddress.ctl
UserControl=VBCCR15\Builds\ImageCombo\ImageCombo.ctl
UserControl=VBCCR15\Builds\ImageList\ImageList.ctl
UserControl=VBCCR15\Builds\LabelW\LabelW.ctl
UserControl=VBCCR15\Builds\LinkLabel\LinkLabel.ctl
UserControl=VBCCR15\Builds\ListBoxW\ListBoxW.ctl
UserControl=VBCCR15\Builds\ListView\ListView.ctl
UserControl=VBCCR15\Builds\MCIWnd\MCIWnd.ctl
UserControl=VBCCR15\Builds\MonthView\MonthView.ctl
UserControl=VBCCR15\Builds\OptionButtonW\OptionButtonW.ctl
UserControl=VBCCR15\Builds\Pager\Pager.ctl
UserControl=VBCCR15\Builds\ProgressBar\ProgressBar.ctl
UserControl=VBCCR15\Builds\RichTextBox\RichTextBox.ctl
UserControl=VBCCR15\Builds\Slider\Slider.ctl
UserControl=VBCCR15\Builds\SpinBox\SpinBox.ctl
UserControl=VBCCR15\Builds\StatusBar\StatusBar.ctl
UserControl=VBCCR15\Builds\SysInfo\SysInfo.ctl
UserControl=VBCCR15\Builds\TabStrip\TabStrip.ctl
UserControl=VBCCR15\Builds\TextBoxW\TextBoxW.ctl
UserControl=VBCCR15\Builds\ToolBar\ToolBar.ctl
UserControl=VBCCR15\Builds\TreeView\TreeView.ctl
UserControl=VBCCR15\Builds\UpDown\UpDown.ctl
```

Sample errors:



> 'DataReport1' can not be public in this type of project.  The item has been changed to private.





> Errors during load. Refer to 'X:\repo\VBCCR15\Builds\Animation\PPAnimationGeneral.log' for details


The log file shows:



> Line 12: Class VBCCR15.CheckBoxW of control CheckMouseTrack was not a loaded control class.
> Line 22: Class VBCCR15.ComboBoxW of control ComboMousePointer was not a loaded control class.
> Line 32: Class VBCCR15.ComboBoxW of control ComboBackStyle was not a loaded control class.
> Line 42: Class VBCCR15.CheckBoxW of control CheckCenter was not a loaded control class.
> Line 52: Class VBCCR15.CheckBoxW of control CheckAutoPlay was not a loaded control class.
> Line 62: Class VBCCR15.CheckBoxW of control CheckEnabled was not a loaded control class.

----------


## DEXWERX

oh man... the OCX project is not meant to be incorporated into another project. The source is provided so you can compile the original OCX, (hopefully with a copy of an already compiled version to keep binary compatibility!)




> It is not recommended to use the source code to compile another binary.


If you want to use these outside of the OCX - use the std EXE project code.

if you don't know what the manifests are for - or why you use them, don't download them. you don't need them.

----------


## kaps

Hi Krool,

This is about using the VBCCR15.OCX Registration-Free. 
I have used VBCCR15.OCX in our project. Now I need to use the project's executable file in end user machine without registering the .OCX file. 
I have registered the VBCCR15.OCX file in my machine. Please tell me about the follows.
1) Can we just include the Side-by-side resources (as in your comment) anywhere inside the project?
2) Do we need to add those side-by-side resources in the same folder with .exe and .ocx file in the 'End user' machine?

Thank you.

----------


## Krool

> 1) Can we just include the Side-by-side resources (as in your comment) anywhere inside the project?


What you mean with anywhere? It can only be added into the Resource section in the Std-EXE project.




> 2) Do we need to add those side-by-side resources in the same folder with .exe and .ocx file in the 'End user' machine?


The resource file is embedded into the .exe file. No resource file is placed on any folder.

----------


## kaps

Hi Krool,

Thanks for the reply. 

I think I haven't mention about the right scenario of my project in my previous comment. I am sorry for that. 
We have used VBCCR15.OCX in our project and our final result is a .dll file (Ours is not a Standard EXE project and it is a ActiveX DLL project ). We create an executable file separately to include the Project.dll file and other relevant files into the client computer, and now I want to use the Project.dll file without registering the VBCCR15.OCX file in the client machine.  Can we still use the steps mentioned by you in your tutorial? 
However I have tried to include the Side-By-Side resource files that you have attached into the project. I am unable to add more that one resource file into the project and also unable to add VBCCR15.OCX.rar , unsupportive format. I guess this is because this is a ActiveX DLL project. 

I used http://www.mazecomputer.com/ and created a manifest file(Project.dll.manifest) by adding our Project.dll and VBCCR15.OCX into the Side-By-Side manifest maker. I am still unable to fulfill my need. Can you please help me with this. 

Thank you.

----------


## lrd_VB6

Hello,

Here is the last update of my converter for the latest version of VBCCRxx (15).
Translates sources using VBCCR xx to version 15.
All converted files are saved (.bak) as a precaution.

When you have a project of 10000 lines, it's handy!

Fixed a bug in the conversion of the vbp file (Thanks MountainMan)

Good work

Attachment 157199

----------


## Krool

Included LinkSwitch /OPT:NOWIN98 on the VBCompiler which reduced the file size of the OCX binary by about ~10KB

----------


## StephanK

Hello Krool,

awesome replacement for the MS controls. They look nice!
I got a problem, and I hope I didn't miss something silly. I'm trying to use the datepicker control with CalendarShowWeekNumbers = TRUE.
When I click on the datepicker nothing happens. This works fine when the option is OFF.

Please tell me what I'm doing wrong.
Thanks, Stephan

----------


## labmany

When adding *VB Common Controls Replacement 1.5 Library* to an exist VB6 project and try to open it again it gives the following error: 
Run-time error '713 
Class not registered

It works OK with any new project!

Am I missing something?!

----------


## Krool

Update released.

VBCCR16.OCX

----------


## misern

First of all, congratulations for this great job.

Recently I needed to translate a program with unicode characters, So your controls had been fantastic.

Everything worked perfect except just one thing, that I'm not able to fix myself (I've not enougth skills).

I use traffic light icons to show states. At the startup, I load this 3 images (red, orange and green) from my resource and store them to global variables.

In most of my forms, I show a listView with this icons, so I have on each form, one imageList and one listview controls. The problem consist in everything works OK, but just once, I mean, doesn't matter witch form I open first, but first time everything is OK, on the following ones, instead the trafic light, I got a black square. Same code worked before as a charm on the original microsoft controls.


I got a method that prepare that list before it is populated.


```
Public iOrange As IPictureDisp
Public iGreen As IPictureDisp
Public iRed As IPictureDisp


Public Sub PreparaSemaforsBreuW(ByRef IL As VBCCR16.ImageList, ByRef LV As VBCCR16.ListView)
    Dim CH As VBCCR16.LvwColumnHeader
    
    IL.ListImages.Clear
    IL.ListImages.Add 1, , iOrange
    IL.ListImages.Add 2, , iRed
    IL.ListImages.Add 3, , iGreen
    IL.UseMaskColor = True
    LV.ForeColor = DG.InvColor
    LV.BackColor = DG.BGColor
    Set CH = LV.ColumnHeaders.Add(1, , "Tittle", 1800)
    LV.HideColumnHeaders = False
    LV.Width = 1800 + 270
    Set LV.SmallIcons = IL
    LV.BorderStyle = CCBorderStyleNone
End Sub
```

Then I populate like this


```
LV.ListItems.Add(, , 1234, , 3)
```

I tested with VBCCR15.OCX and with the current version 1.6.4 VBCCR16.OCX

----------


## misern

Sorry, I forget to mention, that the problem only apears on compiled DLL, when debug work OK.

Ups, Don't know why, seems this post appears before the original (that I got a message, telling me that must be approved by moderator first).

----------


## misern

Hello,  Again, this is disturbing, don't know why seems today is working perfect on compiled version.

Respect to the microsoft original code, I Added this piece of code (already present on previous post), and seems helped. Maybe will help you to realize what's going on


```
IL.ListImages.Clear
```

----------


## misern

Hello,  Again, this is disturbing, don't know why seems today is working perfect on compiled version.

Respect to the microsoft original code, I Added this piece of code (already present on previous post), and seems helped. Maybe will help you to realize what's going on


```
IL.ListImages.Clear
```

----------


## Krool

Hello misern,

Thanks for your report. Can you please bundle an isolated demo showing the issue so I can evaluate the reason.

----------


## misern

Hello,

Attached a sample source code. On my PC, from IDE it works OK, but the exe, only once

Test.rar.docx

Please remove the docx suffix

----------


## Krool

misern, thanks.

unfortunately I could not resolve it. It's not happening when using the Std-EXE version. Only when compiled and use of OCX.

Further observation: When you load just on image at design-time to the image list directly then there is no issue. You can keep all code unchanged. Just add a random picture at design-time to the image list on form2 and form3 and the issue is gone. I don't know why...

----------


## misern

Hello Krool,

Many thanks for your time an effords. I suspect that picture is deleted on form unload. I'm thinking to assign a cloned image.

----------


## Krool

misern,
I have resolved the issue with the ImageList. You can use your code unchanged.




> Respect to the microsoft original code, I Added this piece of code (already present on previous post), and seems helped. Maybe will help you to realize what's going on
> 
> 
> ```
> IL.ListImages.Clear
> ```


That's not necessary (anymore)

----------


## misern

Many thanks, I just tested, works perfect!!!!

----------


## DEXWERX

I might be missing something obvious, but why does CommonDialog.cls need to use registry entries to be used in scripts vs just having the  class Implement IObjectSafety?

Thanks!

----------


## Krool

> I might be missing something obvious, but why does CommonDialog.cls need to use registry entries to be used in scripts vs just having the  class Implement IObjectSafety?
> 
> Thanks!


There is a good reason for this.
Having Implements in UserControl is no problem as only an amalgamation is exposed in the OCX.
However, using Implements in Classes exposes the interfaces directly.
Means: any one using OCX would need to install OLEGuids.tlb and that's a no-go.

----------


## DEXWERX

ah! Thanks. 
That's too bad that Classes are treated differently than User Controls in the OCX.

----------


## pramod9763

In a new VB project everything works perfectly. 

But when I try to add 'VB Common Controls Replacement 1.6 Library' in my existing project from 'Project > Components' box and click on Apply button, I get the message "Name conflicts with existing module, project, or object library". Does anyone have solution?

----------


## pramod9763

> In a new VB project everything works perfectly. 
> 
> But when I try to add 'VB Common Controls Replacement 1.6 Library' in my existing project from 'Project > Components' box and click on Apply button, I get the message "Name conflicts with existing module, project, or object library". Does anyone have solution?


The file VBCCR16. OCX was mentioned twice in the VBP file of my project that caused the problem. I deleted both mentions in the file and referenced file again. This time it loaded perfectly!

----------


## pramod9763

Duplicate post

----------


## pramod9763

The ComboBoxW control allows to edit at Property Style= 0. What if I don't want the user to edit in the control. I just want him to select item from drop-down list. I tried using property Locked =  True. But then ComboBoxW only let the user to Drop the items but it does not let him select the item. 
Please suggest a solution!

----------


## pramod9763

The ComboBoxW control allows to edit at Property Style= 0. What if I don't want the user to edit in the control. I just want him to select item from drop-down list. I tried using property Locked =  True. But then ComboBoxW only let the user to Drop the items. However, it does not let him select the item. 
Please suggest a solution!

----------


## pramod9763

> The ComboBoxW control allows to edit at Property Style= 0. What if I don't want the user to edit in the control. I just want him to select item from drop-down list. I tried using property Locked =  True. But then ComboBoxW only let the user to Drop the items. However, it does not let him select the item. 
> Please suggest a solution!


I should have used Property Style = 3.
That solved the problem!

----------


## PauloFranc

Hello,

Is there any thing similar to VisualStyles that can be done to the aspect of the forms?

Thanks

----------


## Krool

> Hello,
> 
> Is there any thing similar to VisualStyles that can be done to the aspect of the forms?
> 
> Thanks


Forms are automatically visual styled. Or what do you mean exactly?

----------


## PauloFranc

Ok, thanks.

I was just wondering about the borders and format of the corners for example.

----------


## PauloFranc

Ok, thanks.

I was just wondering it I should do something about the borders and format of the corners for example.

----------


## kavian

Hi Krool,
first, thanks for your great work.
I encountered a bug when using your ActiveX Component.
LinkLabel control with transparent back style, works great in normal DPI size (96 DPI - 100%). But, in 192 DIP (200%), it completely cluttered and the background color becomes black. By changing the Transparent Property to False, everything works well again.



I apologize for my poor English.
Thanks

----------


## labmany

I have a problem with the DTPicker control!
It works ok as long as the application is loaded without manifest file (not themed) like this :



When loaded with the manifest (.manifest File or even Resource) it looks like this :



The format is reversed which ruins the display and causes a lot of confusion.
My Windows regional setting are: 
Format: Arabic Egypt
Location: Egypt

When I change the Format to, say, English (United States) it works ok.
I tried to change the system date format from code before initializing the theme but it does not work.

Although Arabic is Right To Left language but numbers, dates and time is left to right (well, Date can be used both ways but not Time)
Even if we typed in Hindu numbers all is left to right except date unless we type in Arabic numbers it is Left to Right for All:

Hindu date and Time:
٢٠١٩/١٠/١٣ (all is right to left)   or  ١٣/١٠/٢٠١٩  (all is left to right but its ok as long as years are in YYYY format)
٠٧:٤٢ ص    (hours are left and minutes are right) in the themed screen shot time is 42 as hours and 7 as minutes which is wrong!

Arabic numbers:
13/10/2019  (all left to right)
07:42 ص      (all left to right)

Any suggestions?

----------


## Krool

> Hi Krool,
> first, thanks for your great work.
> I encountered a bug when using your ActiveX Component.
> LinkLabel control with transparent back style, works great in normal DPI size (96 DPI - 100%). But, in 192 DIP (200%), it completely cluttered and the background color becomes black. By changing the Transparent Property to False, everything works well again.
> 
> 
> 
> I apologize for my poor English.
> Thanks


Please try LinkLabel1.Refresh for the meantime. It should resolve it. I'm looking for a fix which will makes the .Refresh not needed.

EDIT: OCX has been updated. It should now work even without extra .Refresh.

----------


## kavian

Hi Krool, Thanks for update. now the control is working properly.

But two more. In 200% DPI:

1. The label size doesn't change correctly (Autosize property is set to True).



2. The icon size of any controls that use the ImageList, doesn't change correctly. Also the Toolbar control, isn't DPI-aware. These bugs are not present in the Std-EXE version.

----------


## Krool

> But two more. In 200% DPI:
> 
> 1. The label size doesn't change correctly (Autosize property is set to True).


AutoSize for LabelW at design time is only a 1 time Autosizing, because the behavior is then that the size can be freely changed afterwards..
It works when design time DPI is same as run time DPI.

However, to be sure in all cases it is better to apply an .AutoSize = True during Form_Load again.

The intrinsic VB.Label has the same behavior. So I don't consider this as a bug, but rather a feature.  :Smilie:

----------


## MountainMan

Krool,

I have 3 questions regarding using the OCX version of the controls. 

1 - What modules, if any, of the Std-EXE version need to be included when we use the OCX version? You  have 3 modules int eh Std-EXE version that are general to all of the forms, Common.bas, Startup.bas and VisualStyles.bas. Are any of these needed to use the OCX version?

2 - In the Std-EXE version demo, at the start of each of the forms is code to call SetupVisualStylesFixes which resides int he aforementioned VisualStyles.bas module. Do we need to do this  at the start of any/all our forms to get theming and visual styles or is that done automatically in the OCX version?

3 - If these are no specials subs to run at startup using the OCX version, then is there still the requirement that the program starts from Sub Main instead of going to a form? If so, what initialization code should we call before going to a form?

As a general comment, it might be nice to have a simple sample using the OCX version which would help us understand what we need to do besides side-by-side to get it to work with modern themes etc. If you want, I could cook up your Std-EXE sample for use with the OCX if you can help me understand the start-up things like in my questions above.

Thanks.

----------


## Krool

> Krool,
> 
> I have 3 questions regarding using the OCX version of the controls. 
> 
> 1 - What modules, if any, of the Std-EXE version need to be included when we use the OCX version? You  have 3 modules int eh Std-EXE version that are general to all of the forms, Common.bas, Startup.bas and VisualStyles.bas. Are any of these needed to use the OCX version?
> 
> 2 - In the Std-EXE version demo, at the start of each of the forms is code to call SetupVisualStylesFixes which resides int he aforementioned VisualStyles.bas module. Do we need to do this  at the start of any/all our forms to get theming and visual styles or is that done automatically in the OCX version?
> 
> 3 - If these are no specials subs to run at startup using the OCX version, then is there still the requirement that the program starts from Sub Main instead of going to a form? If so, what initialization code should we call before going to a form?
> ...


Using VBCCR16.OCX is no different than using COMCTL32.OCX. Again: No difference.

What do you do to get theming? You make a manifest file
What do you do to use COMCTL32.OCX regfree ? You make a manifest file, same for VBCCR16.OCX

VisualStyles.bas is only helping by fixing some issues with the theming, mostly for the intrinsic VB.Controls.

----------


## MountainMan

In the StdEXE version of these controls you added the VListBox on 6/23/2020 control and on 7/24/2020 you added the VListBox control. When I use the current latest version here (v1.6.126) of the OCX version I do not see these controls available for use. Have you not included them yet? If so, does that mean they won't be available until version 1.7?

----------


## Krool

> In the StdEXE version of these controls you added the VListBox on 6/23/2020 control and on 7/24/2020 you added the VListBox control. When I use the current latest version here (v1.6.126) of the OCX version I do not see these controls available for use. Have you not included them yet? If so, does that mean they won't be available until version 1.7?


Yes. 1.7 will be released soon and then all will be updated.

----------


## MountainMan

Thanks. I am just about to release an update tot he compile utility and wanted to make sure I wasn't doing something dumb...

----------


## Krool

Update released.

VBCCR17.OCX

----------


## MountainMan

In your new OCX there are 34 controls but 64 GUID's. I am trying to get the updater fixed for this new version but I have a question about those GUID's that don't have control names associated with them. In previous versions, the order of the GUID's and controls were all in the same order but this time you changed them a lot. My basic question is can these GUID's not associated with a control name who up as such in someone's project? If not I can just upgrade controls from earlier versions to 1.7 and basically not pay attention to these GUID's but if they can show up in someone's code then I have to relate each one to the previous unnamed GUID's and I might need some help learning which ones go with which controls.

----------


## Krool

> In your new OCX there are 34 controls but 64 GUID's. I am trying to get the updater fixed for this new version but I have a question about those GUID's that don't have control names associated with them. In previous versions, the order of the GUID's and controls were all in the same order but this time you changed them a lot. My basic question is can these GUID's not associated with a control name who up as such in someone's project? If not I can just upgrade controls from earlier versions to 1.7 and basically not pay attention to these GUID's but if they can show up in someone's code then I have to relate each one to the previous unnamed GUID's and I might need some help learning which ones go with which controls.


The GUID's are now sorted alphabetically. (beside CommonDialog class kept on top)
All unnamed GUID's belong to their "upper" control.

Example: the GUID C3853FC8-E7D9-43D4-88AA-4DF0651E66B1 is unnamed, but the prior GUID is stated VBCCR17.Animation. So their belong to each other.
And so on.



```
clsid="{068A3E97-D041-4248-AEEE-56B09D8D037C}"  progid="VBCCR17.CommonDialog" />

clsid="{9602627B-40A9-4638-B4CD-39A365F85432}"  progid="VBCCR17.Animation" />
clsid="{C3853FC8-E7D9-43D4-88AA-4DF0651E66B1}"  />
clsid="{5F2AB905-9655-4A13-9F7E-433EDFF185F2}"  progid="VBCCR17.CheckBoxW" />
clsid="{14959488-6EF6-4323-A7CB-7165F32D8CC2}"  progid="VBCCR17.ComboBoxW" />
clsid="{A6C631D4-7449-44DC-9AD2-D86357554975}"  progid="VBCCR17.CommandButtonW" />
clsid="{5B07381D-39B9-40BF-9EE3-AF0636276897}"  progid="VBCCR17.CommandLink" />
clsid="{8AC46A3E-727E-48EC-A063-4FC42CB744F4}"  />
clsid="{03F663A5-EF57-4F73-BDAF-31C5E673B739}"  progid="VBCCR17.CoolBar" />
clsid="{1908EE8D-074B-4C73-A650-02BE9202D3A2}"  />
clsid="{4BFD0894-5927-4DF9-B65C-19632904D2BC}"  />
clsid="{ED9B663D-A5CA-4D5F-A35E-F337009BA0B9}"  progid="VBCCR17.DTPicker" />
clsid="{B73EA339-27D1-46CF-9FE9-D166C46248DD}"  />
clsid="{67E6130D-31EA-4462-8B7B-35C8D00B8878}"  progid="VBCCR17.FontCombo" />
clsid="{2FDC9106-3494-4747-8FB2-61D379DD0A82}"  progid="VBCCR17.FrameW" />
clsid="{3760E97F-F505-4A7E-A7B9-A5D4D475832E}"  progid="VBCCR17.HotKey" />
clsid="{277DDA80-4A98-4736-A23D-A1C200E791A6}"  progid="VBCCR17.ImageCombo" />
clsid="{04A8661E-B343-4EBC-AB7C-3910DFBE1B18}"  />
clsid="{6993750D-0041-47C0-BF0F-7F82F68949C1}"  progid="VBCCR17.ImageList" />
clsid="{6C56E631-FF75-42B2-B4B7-8B4031550584}"  />
clsid="{CB5DEA21-63B5-480B-BEFE-5EE5314722C5}"  />
clsid="{D717FCAC-DDEF-4CF3-BA30-FDEFC64C097B}"  progid="VBCCR17.IPAddress" />
clsid="{3F8EFA5D-6EE2-4243-B181-997284B86913}"  />
clsid="{E3C54ADB-EED1-4D03-9F7B-4D42EA7BFC7D}"  progid="VBCCR17.LabelW" />
clsid="{9F562C7A-EC4B-4E02-85D2-CE42203EC994}"  progid="VBCCR17.LinkLabel" />
clsid="{63904521-756C-4F8B-BFB8-4944B436C4BA}"  />
clsid="{3E22EA9C-D403-4C3B-B5DA-96DD4AC8EC93}"  progid="VBCCR17.ListBoxW" />
clsid="{172DFD6D-064E-4E31-9558-89096C3B2C07}"  progid="VBCCR17.ListView" />
clsid="{34FC2451-FF36-4A5C-953F-6C5C79A1700E}"  />
clsid="{0A1CF8E6-385A-4627-ABF7-87ADA3C542B0}"  />
clsid="{0EBECF21-3927-421A-B70E-138694D86EB2}"  />
clsid="{9AE1DA41-2B6E-495E-9403-69DB3C6B4D7A}"  progid="VBCCR17.MCIWnd" />
clsid="{45A07E72-1CBF-43BB-804D-816A071DF623}"  progid="VBCCR17.MonthView" />
clsid="{03DDF33B-3D29-4888-8EDC-70C02072CEEA}"  />
clsid="{E7C8AA1C-5D9D-4E69-AA90-B271F3CD418B}"  progid="VBCCR17.OptionButtonW" />
clsid="{8D5766F1-B256-46AF-8A55-4DEA235F71F1}"  progid="VBCCR17.Pager" />
clsid="{8F839938-51C3-4558-916F-E4ED967E88EC}"  />
clsid="{7331C00D-E101-4E1F-AE65-D56EB37263FD}"  progid="VBCCR17.ProgressBar" />
clsid="{479EC666-5FF8-43C8-A2E6-D53853D0138C}"  />
clsid="{71C2F1C5-7282-468B-9159-1BC4B7D3C90F}"  progid="VBCCR17.RichTextBox" />
clsid="{D8707683-3AB9-41E2-B923-B32F3449A288}"  />
clsid="{FE7B5DA6-4D26-41C1-B5E1-3FD2C26638CB}"  progid="VBCCR17.Slider" />
clsid="{515D25BE-D6CF-4C3E-96EE-79DBDA944B34}"  />
clsid="{A4822523-E1D8-4802-912F-6825CBCF7EA2}"  />
clsid="{BE90171C-60AC-404E-91CD-48C36B7EB5D0}"  progid="VBCCR17.SpinBox" />
clsid="{C5366161-D0E7-49F6-95F3-788BA9600617}"  />
clsid="{73DEDEDA-B899-4B59-883C-C8F66C2C7A9B}"  progid="VBCCR17.StatusBar" />
clsid="{560F8AC8-028D-4F88-BEEC-67FFEE357466}"  />
clsid="{7C2A3132-2779-4D2B-B687-052B994E0602}"  />
clsid="{FD6C1D42-591A-4D59-873B-3825E0F9A48F}"  progid="VBCCR17.SysInfo" />
clsid="{5A449BC4-90AA-47FA-B2B5-D8B555EF91EF}"  progid="VBCCR17.TabStrip" />
clsid="{00EC79F7-8382-4217-9943-3CC8A0B251A6}"  />
clsid="{269A7AD4-CFE9-4655-A070-C1D3CC1AE00F}"  />
clsid="{C08B5E24-A816-480C-A0D9-52173F420F3F}"  progid="VBCCR17.TextBoxW" />
clsid="{B700EB90-2F14-4776-969D-40726357016A}"  />
clsid="{BD34E876-94B4-4A0E-A9CC-CC64D0580F08}"  progid="VBCCR17.ToolBar" />
clsid="{E441BD93-5F11-492E-A22C-C3F36DC07716}"  />
clsid="{7476271E-C33F-4A1A-84ED-A4373AA7B9C6}"  />
clsid="{4A1E23DB-0330-4BF9-8CB1-8DED96FF0A72}"  progid="VBCCR17.TreeView" />
clsid="{B2B4454B-913E-40E4-8FE2-77B9BB082924}"  />
clsid="{9C41E0AA-3074-497D-A552-FD9E2720AA36}"  progid="VBCCR17.UpDown" />
clsid="{5AFF51F6-4021-4B90-82D3-F59A5F34CCB6}"  />
clsid="{2FA19598-CAE7-4257-8892-6EE4DA1158E8}"  progid="VBCCR17.VirtualCombo" />
clsid="{F1457E04-22FC-4D37-B4C1-E5126DF9DBDC}"  progid="VBCCR17.VListBox" />
```

----------


## MountainMan

Thanks. Tha's what I thought you did. How about the earlier ones? For example, in VBCCR16.OCX the 4th one is {F37CEF7D-65C4-4F00-9874-B698A08EB948} and it is after UpDown but before TreeView. Was it part of UpDown?

----------


## Krool

> Thanks. Tha's what I thought you did. How about the earlier ones? For example, in VBCCR16.OCX the 4th one is {F37CEF7D-65C4-4F00-9874-B698A08EB948} and it is after UpDown but before TreeView. Was it part of UpDown?


Don't know for VBCCR16. It wasn't sorted..

For VBCCR16 I would check with RegEdit.. For instance {F37CEF7D-65C4-4F00-9874-B698A08EB948} returns in RegEdit (CTRL+F find method) VBCCR16.PPTreeViewGeneral. So it relates to TreeView.

----------


## MountainMan

It looks to me that in prior versions you had the associated GUID's before the named ones. For example, in prior versions, CommonDialog was listed first and there was always an unnamed one then UpDown so it never was clear to me whether the unnamed one went with DommonDialog or UpDown. It didn't matter because your order was consistent across versions so I could match between versions. Now that you have re-ordered the list it is important. CommonDialog is still listed first but now the 2nd entry is not an unnamed one but is Animation so it looks like CommonDialog doesn't have an unnamed one with it. So it seems that prior versions had the unnamed ones were associated with the following named one, not the prior named one. I am sorry for cluttering up the thread with this. I think it only means something to you and me (part of the upgrade utility) so if you want we can take the discussion to PM's.

----------


## MountainMan

Never mind. I am going through the registry as you suggested and it appears there is no rhyme or reason for the older ones, before or after so Ill just comb through the registry and manually match them in my program. Thanks.

----------


## OldClock

Hey Krool

If a project already uses VBCCR16 ActiveX, what is the update process for switching to VBCCR17?

----------


## stanner_austin

> Hey Krool
> 
> If a project already uses VBCCR16 ActiveX, what is the update process for switching to VBCCR17?


I have same issue .. seems all object need to recreated if wanted to use latest. @Krool can you elaborate on this ?

----------


## Krool

> I have same issue .. seems all object need to recreated if wanted to use latest. @Krool can you elaborate on this ?


You may use the Documentation and Update/Compile Utility from MountainMan to upgrade all references in all Forms from VBCCR16 to VBCCR17.

----------


## Erwin69

I thought to start 2021 in a good way by upgrading my application to full Unicode support, using Krools Common Controls Replacement.  Had noticed them before, but never had time to investigate / implement.  Now Ive read all the threads, and it all sounds great!  To keep things simple, I started with the OCX (version 1.7), thinking that the StdExe option might be something for a later phase, if needed at all.

As my app has 65 forms, some simple, some with many controls on them, I wondered if there isnt a quick way to replace the "old controls" with the new versions by simply editing the frm-files in a text-editor?  Or is it really a matter of rolling up the sleeves, and going through each form replacing each individual control manually?

----------


## DaveInCaz

Hi Erwin69, yes that is exactly how I did it, editing the frm files by hand. You have to edit all the control types / classes in the "header" section of the frm, but also you will have to change classes and enums elsewhere in code, typically event handlers.

Also there are some cases where data will be stored for the original in the FRX files and that will have to be manually reset. I recall taking screenshots of things like imagelists so that I could rebuild them later.

IIRC I studied the codebase first to try & ID all the cases I had, and then used regex search & replace for a lot of it.

I would recommend working in stages, keeping backups along the way, etc.  Good luck!

----------


## Erwin69

Thanks Dave.  It's an interesting exercise, and your suggestion to work in stages most definitely is an important one.  I had hoped for a quick search and replace across all frm-files using Notepad++, but that was thinking too simple...

On top of it there is the additional challenge of converting the external text-files that contain translations in among others Korean and Russian into Unicode text-files, and then properly read and process them.  (They now only work if the code page is set to those languages.)

Quite a few challenges ahead...  :big yellow:

----------


## Erwin69

OK, making some progress, but ran into something today:

In a frame I have 3 shapes, that visually show the status of something, traffic light style.  Since shapes don't have events, I'm using the mousedown event of the frame to capture the X-, and Y-coordindates, and check those versus the position of the shapes.

This worked fine with the original Frame object, but with the FrameW object, the X and Y that the event returns, don't correspond with the coordinates of the shapes.  My guess is that a different scaling is used?

Any advice is appreciated!

----------


## hmnader

hi there 
I downloaded the VBCCR17.OCX.rar.zip file and removed the zip extension, but got an error when I tried to extract it 
can anyone help me?

----------


## Krool

> hi there 
> I downloaded the VBCCR17.OCX.rar.zip file and removed the zip extension, but got an error when I tried to extract it 
> can anyone help me?


You can download it from Github also. (Without it being archived)

----------


## myfav

Krool,  thanks for the great work!

I tried to place the "[VB6] ActiveX CommonControls" in the MS VFP's IDE:

LabelW's OK!
CommandButtonW's OK!
CheckBoxW's OK!
RichTextBox's OK!
TreeView's OK!

But unfortunately "TextBoxW" CRASHED while I just placed it into the Form in DesignMode! I've download the "UniText"(https://www.vbforums.com/showthread....ase-2008-06-19) before, it's OK. I think maybe there's something wrong with TextBoxW during UserControl_Initialize() while TextBoxDesignMode's True.

----------


## Krool

> Krool,  thanks for the great work!
> 
> I tried to place the "[VB6] ActiveX CommonControls" in the MS VFP's IDE:
> 
> LabelW's OK!
> CommandButtonW's OK!
> CheckBoxW's OK!
> RichTextBox's OK!
> TreeView's OK!
> ...


Hmm. I don't know. Why does the more complex RichTextBox work but not the TextBox?
IMO UserControl_Initialize is not the cause as TextBoxDesignMode's not True there yet.
Can you compile the OCX again for testing and put off Call CreateTextBox in sub _InitProperties and _ ReadProperties?
So we pinpoint if it has something todo with the UserControl or the API window.

----------


## MountainMan

Version 3 of the Documentation and Compile Utility for Krool's controls has been released here.

 MountainMan

----------


## Caine

First of all, thank you very much for your efforts, Krool. Your controls work very reliably and I use them quite often these days.

I do have an issue with ImageLists and property pages, though. Here's how to reproduce:

Create a new project and add a reference to VBCCR17Add two image list controls to a formOpen the property page and add an imageNow, without closing the property page select the second image list and add an imageUpon selecting an image the IDE produces a run-time error 0
Afterwards, if you try to open the property page there are some follow-up errors like "Runtime-error -2147221164 (80040154) [Class not registered]" and "Automation error" without any additional information. A restart of the IDE is required to get things working again.

If you were to save the project after having properly added an image or two to the ImageList controls and try to re-use the property page, all the saved images are lost.

This procedure just works with the original ImageList.

----------


## Krool

> First of all, thank you very much for your efforts, Krool. Your controls work very reliably and I use them quite often these days.
> 
> I do have an issue with ImageLists and property pages, though. Here's how to reproduce:
> 
> Create a new project and add a reference to VBCCR17Add two image list controls to a formOpen the property page and add an imageNow, without closing the property page select the second image list and add an imageUpon selecting an image the IDE produces a run-time error 0
> Afterwards, if you try to open the property page there are some follow-up errors like "Runtime-error -2147221164 (80040154) [Class not registered]" and "Automation error" without any additional information. A restart of the IDE is required to get things working again.
> 
> If you were to save the project after having properly added an image or two to the ImageList controls and try to re-use the property page, all the saved images are lost.
> 
> This procedure just works with the original ImageList.


Solved/Fixed. Thanks

----------


## clintc

Thank you *Krool* for this fantastic tool and excellent piece of work!

I am missing the "UpTo" method of the RichTextBox component.

If there are no plans to add it, then I will create in my code a function to do just that (InStr and SetStart).

----------


## Krool

> Thank you *Krool* for this fantastic tool and excellent piece of work!
> 
> I am missing the "UpTo" method of the RichTextBox component.
> 
> If there are no plans to add it, then I will create in my code a function to do just that (InStr and SetStart).


You can post the code here when you are sure it mimics 1:1 to what the MS RTB is doing. I could add this method to VBCCR17 without breaking compatibility...

----------


## wardjk

....

----------


## wardjk

> I've been using VBCCR16.OCX and added VBCCR17.OCX in preparation of upgrading VBCCR16 controls to VBCCR17. The buttons in the VB6 IDE Toolbox for VBCCR17.OCX only show as black squares. The buttons for VBCCR16.OCX still show fine. I'm using VB6 (SP6) on Windows 10. The image shows the symptom. The VBCCR17 buttons are between the standard default buttons and those of VBCCR16. The inclusion of VBCCR16 in the project components does not affect the symptom and is included in the project of this image just for comparison. What can I do to make the buttons of VBCCR17 show the proper icons?
> Attachment 182259


I'd delete this post if I could. I think I had a corrupted OCX. The buttons show fine with the replaced OCX.

----------


## quickbbbb

.........

----------


## quickbbbb

.......

----------


## jpfa

Is there any documentation available appart from what you can get from the object browser?
I have a problem with TextBoxW. If I assign a unicode string to the .Text property the non-Ansi characters are displayed as question marks. If I assign the same string to an unicode api MessageBoxW all the characters are displayed correctly. What am I doing wrong?

----------


## Mith

> I have a problem with TextBoxW. If I assign a unicode string to the .Text property the non-Ansi characters are displayed as question marks. If I assign the same string to an unicode api MessageBoxW all the characters are displayed correctly.


Can you provide us a vb project with the TextBoxW and your unicode string so we can test this at our computer?

----------


## jpfa

It took a while to reduce my project to a small piece just to demonstrate the problem. Maybe it can be reduced even more, but I think this isn't too much code. I kept all the variables and functions involved names untouched. I deleted the unnecessary lines to make it more readable. (My complete project is huge).

You must create a new project and add 2 references:
Debug Object for AddressOf Subclassing   (DbgWProc.dll)
VB Common Controls Replacement 1.7 Library (VBCCR17.OCX)
I assume you have these already registered.

Add one form and set it to be the initial object.
In the form place a TextBoxW control and name it TextBoxW1,
and a CommandButton control and name it Command1.

Add a module.

Code for the form:


```
Option Explicit

Private Declare Function MessageBox Lib "user32.dll" Alias "MessageBoxW" (ByVal hWnd As Long, ByVal lpText As Long, ByVal lpCaption As Long, ByVal wType As Long) As Long

Private Sub MsgBoxW(ByVal Txt As String)
    MessageBox Me.hWnd, StrPtr(Txt), StrPtr("Title"), vbInformation
End Sub

Private Sub Command1_Click()
    Dim Japanese As String

    Japanese = ChrW(49) & ChrW(46) & ChrW(32) & ChrW(37329) & ChrW(30000) & ChrW(19968) & ChrW(32789) & ChrW(21161) & ChrW(12398) & ChrW(12486) & ChrW(12540) & ChrW(12510) & ChrW(32) & ChrW(40) & ChrW(84) & ChrW(104) & ChrW(101) & ChrW(109) & ChrW(101) & ChrW(32) & ChrW(79) & ChrW(102) & ChrW(32) & ChrW(75) & ChrW(111) & ChrW(104) & ChrW(115) & ChrW(117) & ChrW(107) & ChrW(101) & ChrW(32) & ChrW(75) & ChrW(105) & ChrW(110) & ChrW(100) & ChrW(97) & ChrW(105) & ChrW(99) & ChrW(104) & ChrW(105) & ChrW(41) & ChrW(46) & ChrW(109) & ChrW(112) & ChrW(51)
    TextBoxW1.Text = Japanese
    MsgBoxW Japanese
End Sub

Private Sub Form_Load()
    SubclassAll Me, False
End Sub

Private Sub Form_Unload(Cancel As Integer)
    SubclassAll Me, True
End Sub
```

Code for the module:


```
Option Explicit

Public Declare Function CallWindowProc Lib "user32" Alias "CallWindowProcA" (ByVal lpPrevWndFunc As Long, ByVal hWnd As Long, ByVal Msg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long 'en la API "wParam As Long" está mal; debe ser ByVal "wParam As Integer"
Public Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Public Const GWL_WNDPROC = -4

Public DWPHookColl As New Collection
Public lpPrevWndProcColl As New Collection

Public Sub SubclassAll(FrmX As Form, ByVal UnSubclass As Boolean)
    Dim CtrlX As Control
    Dim hWnd As Long
    
    Subclass1 FrmX.hWnd, UnSubclass
    For Each CtrlX In FrmX.Controls
        hWnd = 0
        On Error Resume Next 'CtrlX may not have hWnd
        hWnd = CtrlX.hWnd
        On Error GoTo 0
        If hWnd <> 0 Then
            Subclass1 hWnd, UnSubclass
        End If
    Next
End Sub

Public Sub Subclass1(ByVal hWnd As Long, ByVal UnSubclass As Boolean)
    Dim lpPrevWndProc As Long
    Dim DWPHook As WindowProcHook
            
    If UnSubclass Then
        On Error Resume Next 'lpPrevWndProcColl(CStr(hWnd)) may not exist
            lpPrevWndProc = lpPrevWndProcColl(CStr(hWnd))
        On Error GoTo 0
        If lpPrevWndProc <> 0 Then
            SetWindowLong hWnd, GWL_WNDPROC, lpPrevWndProc
        End If
        On Error Resume Next
            DWPHookColl.Remove (CStr(hWnd)) 'indirectly free WindowProcHook
        On Error GoTo 0
    Else
        Set DWPHook = CreateWindowProcHook
        DWPHook.SetMainProc AddressOf WindowProc
        lpPrevWndProc = SetWindowLong(hWnd, GWL_WNDPROC, DWPHook.ProcAddress)
        DWPHook.SetDebugProc lpPrevWndProc
        DWPHookColl.Add DWPHook, CStr(hWnd)
        lpPrevWndProcColl.Add lpPrevWndProc, CStr(hWnd)
    End If
End Sub

Public Function WindowProc(ByVal hW As Long, ByVal uMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
    Dim PrevWinProc As Long
    
    On Error Resume Next 'lpPrevWndProcColl(CStr(hWnd)) may not exist
    PrevWinProc = lpPrevWndProcColl(CStr(hW))
    On Error GoTo 0
    If PrevWinProc <> 0 Then
        WindowProc = CallWindowProc(PrevWinProc, hW, uMsg, wParam, lParam)
    End If
End Function
```

Run the program in the VB6 IDE.
Click on the Command1 button.

A unicode string will be assigned to the Text property of the TextBoxW1 control.
In my environment (Windows XP sp3) the non-Ansi characters are displayed as question marks.

Then the same string will be correctly displayed by the unicode API MessageBoxW function.

Hope you'll be able to reproduce the problem. I suspect my system is the culprit; if that's the case you won't be able to reproduce it, I guess.

Thanks for your help!

Edit:
If I don't subclass the TextBoxW control then the problem doesn't show, but that would mostly defeat the purpose of using a Text Box. I need to hook some of the messages (mostly the keystrokes and mouse messages). I didn't include this in the reduced code because the problem happens even if I don't preprocess the messages.

----------


## Mith

> If I don't subclass the TextBoxW control then the problem doesn't show, but that would mostly defeat the purpose of using a Text Box.


You didnt wrote anything about "subclassing the textbox" at your first question. I guess Krool uses subclassing for the TextboxW too and this leads to problems...

----------


## jpfa

> You didnt wrote anything about "subclassing the textbox" at your first question.


I didn't mention it in my first question because I didn't know this could have anything to do with the problem. It even didn't come to my mind immediatelly after stripping down my code and posting it. It came to my mind a little later; then I tried disabling the subclassing for just the TextBoxW and found that it indeed could be related to the problem. Then I edited my post to let you know about my new findings.




> I guess Krool uses subclassing for the TextboxW too and this leads to problems...


Can you confirm that guess? Is the code showing the same behavior in your computer as it shows on mine?
If so I'll assume that the control doesn't support subclassing and I'll have to take a different route (maybe using a different unicode text box).
If not, then I'd like to know what's wrong with my code, if you can tell.
But if it all works fine in your computer then I must assume that my system is to blame.

Thanks for your help.

----------


## Arnoutdv

The source is available in this thread:
https://www.vbforums.com/showthread....mmon-controls)

----------


## jpfa

That thread is huge! I wasn't able to spot the source code for TextBoxW at first sight, nor the search applet found it at specific posts(s) in the thread. Can you be more specific about which post # in the thread contains that source code?

----------


## Erwin69

> That thread is huge! I wasn't able to spot the source code for TextBoxW at first sight, nor the search applet found it at specific posts(s) in the thread. Can you be more specific about which post # in the thread contains that source code?


I think you'll find links to the source code in post #1.

----------


## jpfa

> I think you'll find links to the source code in post #1.


If you mean OCX2StdExe v3.2.1.zip, that code just seems to build a standard exe that will have the controls in the ocx embedded so you don't have to distribute the VBCCR17.OCX file along with your executable. I couldn't make that run because of loading errors. Some files seem to be missing. Anyway I don't need to have the ocx embedded into my exe; I just use the ocx. (I'm not distributing this program at all, it's just for my personal use).

ReadMe.docx contains instructions but not code.

----------


## Darkbob

Any idea how to make the MonthView control bigger?  I tried changing the size the usual way by stretching the edges but it's locked at 2440 x 3030.  I manually changed height and width but they changed right back.  I changed the font - nothing.  It seems to be stuck at one specific size.  Any help would be appreciated.

----------

