[VB6] ActiveX CommonControls (Replacement of the MS common controls)
This is the ActiveX Control version that comes out of the Std-EXE version.
Current version: 1.7.104
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:
Code:
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 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.
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
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?)
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
Originally Posted by 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?)
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.
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
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.
Last edited by Darkbob; Jan 29th, 2017 at 12:40 PM.
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
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!
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
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?
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
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')
Code:
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'.
Code:
Private Function StreamStringOut(ByRef Value As String, ByVal Flags As Long) As Long.
I added the following line
Code:
value = left$(value, len(value))
after the line
Code:
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?
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
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
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
Originally Posted by fixxxer
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.
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
Originally Posted by fixxxer
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.
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
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.
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
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.
When you have a project of 10000 lines, it's handy!
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
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:
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:
'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.
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
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.
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
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?
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
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.
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
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)
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
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
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
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
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
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.
Code:
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
Code:
LV.ListItems.Add(, , 1234, , 3)
I tested with VBCCR15.OCX and with the current version 1.6.4 VBCCR16.OCX
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
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
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
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
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
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...
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
misern,
I have resolved the issue with the ImageList. You can use your code unchanged.
Originally Posted by misern
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