Results 1 to 36 of 36

Thread: Krools Common Controls - Documentation and an Update/Compile Utility

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Feb 2015
    Location
    Colorado USA
    Posts
    180

    Krools Common Controls - Documentation and an Update/Compile Utility

    Version 3.0 has been released. See the bottom of this post.

    Krool has been developing a set of common controls replacements sincce 2012. I use them all the time and have found them to be an indispensable part of my VB6 programming library. I have developed some tools to make use of these controls easier which is the basis of this thread. There are 3 major items I cover:

    A user guide. I stumbled through usage of these controls for quite some time and decided to share what I have learned with the community. This is not how to use each control; the controls are fairly similar to those we have been using for years. Rather, I cover

    o There are 4 sets of controls. First, there are all of the controls in one package except for the FlexGrid control and it is in a different package. Then, for each of those there is a pre-compiled version (the OCX versions) and the source code you embed in your code versions Krool calls the StdEXE versions. Where are they, which ones should I use, how do I update them, etc.?

    o What are the pros and cons of using the OCX versions versus the StdEXE versions? Is there some way to take advantage of the best features of each?

    o What type libraries are required and in which versions of the controls?

    o What are visual styles (themes) and how do I use them with Krool’s controls so my programs don’t have that Windows 95 look to them? These require manifest files embedded into resource files embedded into your programs. This sounds intimidating but once you see what’s required it’s not that difficult.

    o What is “side-by-side” and can I use it with Krool’s controls? If so, how?

    An update utility. I develop with the OCX versions of the controls which have progressed over time from version 1.0 in 2012 to the present version 1.6 (just to complicate matters the FlexGrid controls have gone from 1.0 to 1.4). To change from 1.6.12 to 1.6.13 is not too difficult but to go from 1.5 to 1.6 is not trivial. I have a utility that (hopefully) makes that a trivial exercise.

    A compilation utility. I like to develop with the OCX version of the controls because there is one file to manage instead of 153, I don’t have to worry about type libraries and compilations times are at least 10 times faster. However, I like the StdEXE version in my final programs that I distribute because everything is in one executable file, I don’t have to be concerned with side-by-side and I don’t have to distribute anything to my users except that one executable file.

    The update and compilation utilities are in the same program, the code for which is at the end of this post. Many of the modules in the utility are from my personal libraries and I think you may find some useful in other programs. I do have user guides for almost all of them if you are interested.

    The user guide for Krool’s controls is a Word file also at the end of this post. If you can’t use the Word file please let me know what file format you can use and I’ll get it to you.

    If you don’t use Krool’s controls you should really take a look at them. They are far superior to what is built in to VB6 and to any of the controls Microsoft or others have provided over the years for these types of controls.

    This thread will be for the user guide and the utility. If you have questions on the control packages, bug reports, request for new features, etc. please do this in the appropriate thread of Krool’s.

    This is version 2 of this utility. Changes from version 1 include:
    • Use of VBFlexGrid up through 1.4 is covered.
    • Krool’s controls have been replaced with standard VB6 controls. This sounds counterproductive but an update utility should not rely on a given version of the controls during the update. A small part of the change is that the manifest and side-by-side compilation has been removed.
    • It seems that Krool is close to issuing major updates to VBCCR.OCX to version1.7 and VBFlexGrid to 1.5 and this utility is now set-up to quickly add the capability to update ot these new versions.
    • The utility uses a new class module called clINI.cls that saves and restores settings between various runs of the utility in an INI file. The previous version saved settings to the registry. That is still an option but I have moved away from using the registry at all for a variety of reasons so it would require some code modification. Presently the utility will save the INI file into the same folder where the program files are copied.

    Version 2.3 includes the following:
    • Works with VBCCR17.OCX (version 1.7 in addition to 1.1, 1.2, 1.3, 1.4, 1.5 and 1.6)
    • Incorporated my new tooltip class into all of the forms
    • Includes an option to copy a n entire project to oen folder and adjusts the project file accordingly. The original project file is unaffected.
    • Form settings are now stored in an INI file instead of the registry.

    Bug Fix v2.3.1
    If you had your own UserControl &/or PropertyPage in your project (not Krool's controls; your own), these would not get copied into the StdExe folder for that self-contained project compile. Fixed now.

    Version 3.0
    You can specify individual controls to be included in a compile with the StdExe. This feature was added because of the example in post #34 where he wanted to add a control in a standard module with the control name in a variable. I didn't want to have to chase down variable assignments in your code so there is now a feature to deal with that (you should know what controls you add like this so you can turn on those controls to be included in the EXE file). Previously this was an all or nothing proposition.

    StdExe compilation option includes looking inside all project files for references to Krool's controls including .BAS files.

    Bug fixes in StdExe compilation section

    • VirtualCombo and VirtualListbox had been effectively ignored.
    • CommonDialog.cls was left out even if specified to be in.
    • Conditional compilation constants from user project file sometimes were left out.
    • The .PAG files were not referenced in the final .VBP file in the Copy to a sub-folder option.


    Handling of the commandline compile output from the MS compiler/linker was improved.

    Base file locations are now required before a compile with StdExe options from the commandline. If you have not entered these file location values, you will be prompted for them before you can continue.

    Finally, the documentation has been cleaned up and covers this new version.
    Attached Files Attached Files
    Last edited by MountainMan; Mar 29th, 2021 at 04:11 AM. Reason: Version 3.0

  2. #2
    Hyperactive Member
    Join Date
    Aug 2016
    Posts
    510

    Re: Krools Common Controls - Documentation and an Update/Compile Utility

    Quote Originally Posted by MountainMan View Post
    Krool has been developing a set of common controls replacements for the past 6 years. I use them all the time and have found them to be an indispensable part of my VB6 programming library. I have developed some tools to make use of these controls easier which is the basis of this thread. There are 3 major items I cover:

    · A user guide. I stumbled through usage of these controls for quite some time and decided to share what I have learned with the community. This is not how to use each control; the controls are fairly similar to those we have been using for years. Rather, I cover
    o There are 4 sets of controls. First, there are all of the controls in one package except for the FlexGrid control and it is in a different package. Then, for each of those there is a pre-compiled version (the OCX versions) and the source code you embed in your code versions Krool calls the StdEXE versions. Where are they, which ones should I use, how do I update them, etc.?
    o What are the pros and cons of using the OCX versions versus the StdEXE versions? Is there some way to take advantage of the best features of each?
    o What type libraries are required and in which versions of the controls?
    o What are visual styles (themes) and how do I use them with Krool’s controls so my programs don’t have that Windows 95 look to them? These require manifest files embedded into resource files embedded into your programs. This sounds intimidating but once you see what’s required it’s not that difficult.
    o What is “side-by-side” and can I use it with Krool’s controls? If so, how?
    · An update utility. I develop with the OCX versions of the controls which have progressed over time from version 1.0 in 2012 to the present version 1.6 (just to complicate matters the FlexGrid controls have gone from 1.0 to 1.2). To change from 1.6.12 to 1.6.13 is not too difficult but to go from 1.5 to 1.6 is not trivial. I have a utility that (hopefully) makes that a trivial exercise.
    · A compilation utility. I like to develop with the OCX version of the controls because there is one file to manage instead of 153, I don’t have to worry about type libraries and compilations times are at least 10 times faster. However, I like the StdEXE version in my final programs that I distribute because everything is in one executable file, I don’t have to be concerned with side-by-side and I don’t have to distribute anything to my users except that one executable file.

    The update and compilation utilities are in the same program, the code for which is at the end of this post. Many of the modules in the utility are from my personal libraries and I think you may find some useful in other programs. I do have user guides for almost all of them if you are interested.

    The user guide for Krool’s controls is a Word file also at the end of this post. If you can’t use the Word file please let me know what file format you can use and I’ll get it to you.

    If you don’t use Krool’s controls you should really take a look at them. They are far superior to what is built in to VB6 and to any of the controls Microsoft or others have provided over the years for these types of controls.

    This thread will be for the user guide and the utility. If you have questions on the control packages, bug reports, request for new features, etc. please do this in the appropriate thread of Krool’s.
    You are such a very enthusiastic person.Merry Christmas

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Feb 2015
    Location
    Colorado USA
    Posts
    180

    Re: Krools Common Controls - Documentation and an Update/Compile Utility

    Nineteen years ago I had a cardiac arrest and I was dead for 10 minutes. That really makes you look at life differently. I realize that a)I am not in control like i thought I was and b)I don't know if i will be on this planet for another nano-second so I'd better make the most out of what I have.

    I have benefited a lot from this forum and this is one way I can give back. My contribution to this is tiny compared to what Krool has done. I hope you find it worthwhile...

  4. #4
    Hyperactive Member
    Join Date
    Aug 2016
    Posts
    510

    Re: Krools Common Controls - Documentation and an Update/Compile Utility

    As a business vb enthusiast, I look forward to your more good sharing. Here may be the last forum

  5. #5
    PowerPoster
    Join Date
    Sep 2012
    Posts
    2,083

    Re: Krools Common Controls - Documentation and an Update/Compile Utility

    Quote Originally Posted by MountainMan View Post
    Nineteen years ago I had a cardiac arrest and I was dead for 10 minutes. That really makes you look at life differently. I realize that a)I am not in control like i thought I was and b)I don't know if i will be on this planet for another nano-second so I'd better make the most out of what I have.

    I have benefited a lot from this forum and this is one way I can give back. My contribution to this is tiny compared to what Krool has done. I hope you find it worthwhile...
    There are a lot of enthusiasts in this forum, including some gentlemen, and Krool is a gentleman. Thank you, MountainMan.
    Last edited by dreammanor; Dec 21st, 2018 at 10:23 PM.

  6. #6
    Member
    Join Date
    Aug 2016
    Posts
    47

    Re: Krools Common Controls - Documentation and an Update/Compile Utility

    Hello,
    I have created a script to alternative.
    I had a problem with the module parser with the program of "MountainMan", so, it was easier for me to create a program that does the same as the program OCX2StdEXE


    convert_OCX2StdExe.zip

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Feb 2015
    Location
    Colorado USA
    Posts
    180

    Re: Krools Common Controls - Documentation and an Update/Compile Utility

    Duplicate post (grrr...)
    Last edited by MountainMan; Jan 1st, 2019 at 02:41 AM. Reason: Duplicate post

  8. #8

    Thread Starter
    Addicted Member
    Join Date
    Feb 2015
    Location
    Colorado USA
    Posts
    180

    Re: Krools Common Controls - Documentation and an Update/Compile Utility

    The parser is only used for commandline execution of the utility. I don't do much script but I don't think that the "CommandW" function or "Command$" will work in Linux, at least as you have it written. You don't need this if you were to use the input forms but I also don't know if you can do forms in Linux Bash scripting. If you were to make a text file (default ANSI is fine) with the lines you need to add (such as the location of Krool's Demo files) then you could likely do everything in your script and not need to make a new project file that requires further editing before it can be compiled.

    You have an interesting start. Here are some things I suggest you consider:

    - Right now you only have support for VBCCRxx.OCX. At some point you might want to add support for VBFLXGRD.OCX as well. They really are very similar. I am guessing that by version 1.7 or 1.8 Krool will include VBFLXGRD into the larger common controls packages.

    - You also only have support for v1.6 of VBCCRxx.OCX. At some point there will likely be a 1.7, 1.8 and so on. Rather than assume the code is only for 1.6 you might want to read the project file and determine which version is being used and then adjust accordingly.

    - Starting in line 298 you list out the possible module that need to be added to the project file in order to use the ComCtlsDemo version of the controls. At the very least you should have a path to where they are located or tell the user to locate them and modify the script. It wouldn't seem to hard in any script language to put a reference to each of them in the new project file instead of requiring hand editing later. Also, it would be helpful if you checked the project file to ensure that the end user doesn't already have files with any of these name already in the project.

    - Starting in line 308 you list all of Krool's controls and then ask the user to modify the script to un-comment each one that is in use. After a user has 3 or 4 programs that use different controls, this is likely going to get very confusing and will lead to have a special script for each program. Also you would have to remember which controls you add or delete from the project over time. it is not that difficult to read in the project file and from that get all of the controls used in the project from the various module and forms in the project. I started out doing what you are doing and after a couple of months I drove myself crazy so I have my utility find the used controls.

    - It appears in function Main that you make modifications to the references to modules, forms and classes as well as the individual files containing the controls. After I got comfortable with my code I didn't like the fact that I have all of these XXX_ files scattered across my hard drive so I put in an option to delete them after they are used.

    - You will likely need to modify the project's resource file if it has one. It may or may not have an embedded manifest which may or may not be affected by which version of Krool's controls you use. For example, you may have been using the OCX version of the controls but when you switch to the StdEXE version you almost certainly will want to strip out the side-by-side references for Krool's controls since they are no longer going to be side-by-side but instead included in the executable. This get more complicated by 2 factors: 1) there may be other OCX controls the user has in the project that are not like Krool's and there is no source code version to use so the user may want to use side-by-side for the non-Krool OCX controls but not for Krool's controls. So you would need to cut Krool's references out of the resource file but not any other side-by-side references. That was a real hassle in my program. 2) The manifest extracted from a resource file may or may not be in conventional ANSI lines. It is okay to have one big long line that skips the CrLf's (LaVolpe's utility suggests doing this BTW) so you can't just treat the embedded manifest file like lines of text.

    - I am not a Linux guy but I found it to be nice to be able to shell straight from my utility to start an instance of VB6.exe and compile the new code. It's not that difficult to do (do you use Wine for this?) and the code is in my utility. this keeps everything nice and tidy. The user says he/she wants to have a non-OCX version and she/he gets one.

    Good luck with it. If you have any questions, don't hesitate to ask.

  9. #9
    Member
    Join Date
    Aug 2016
    Posts
    47

    Re: Krools Common Controls - Documentation and an Update/Compile Utility

    Quote Originally Posted by MountainMan View Post
    - You also only have support for v1.6 of VBCCRxx.OCX. At some point there will likely be a 1.7, 1.8 and so on. Rather than assume the code is only for 1.6 you might want to read the project file and determine which version is being used and then adjust accordingly.
    Now you can modify the variable VBCCRXX with version you use

    Quote Originally Posted by MountainMan View Post
    - Starting in line 298 you list out the possible module that need to be added to the project file in order to use the ComCtlsDemo version of the controls. At the very least you should have a path to where they are located or tell the user to locate them and modify the script. It wouldn't seem to hard in any script language to put a reference to each of them in the new project file instead of requiring hand editing later. Also, it would be helpful if you checked the project file to ensure that the end user doesn't already have files with any of these name already in the project.
    Now the new script v1.1 scan de *.frm and detect the VBCCR Controls used and add to *.vbp

    Quote Originally Posted by MountainMan View Post
    - Starting in line 308 you list all of Krool's controls and then ask the user to modify the script to un-comment each one that is in use. After a user has 3 or 4 programs that use different controls, this is likely going to get very confusing and will lead to have a special script for each program. Also you would have to remember which controls you add or delete from the project over time. it is not that difficult to read in the project file and from that get all of the controls used in the project from the various module and forms in the project. I started out doing what you are doing and after a couple of months I drove myself crazy so I have my utility find the used controls.
    Is no more necessary. Now modify the Visual Basic Project (XXX_*.vbp)

    Quote Originally Posted by MountainMan View Post
    - It appears in function Main that you make modifications to the references to modules, forms and classes as well as the individual files containing the controls. After I got comfortable with my code I didn't like the fact that I have all of these XXX_ files scattered across my hard drive so I put in an option to delete them after they are used.
    I like this, if you don't like the XXX_* file, you could delete this with cmd.exe /C del XXX_*

    Quote Originally Posted by MountainMan View Post
    - You will likely need to modify the project's resource file if it has one. It may or may not have an embedded manifest which may or may not be affected by which version of Krool's controls you use. For example, you may have been using the OCX version of the controls but when you switch to the StdEXE version you almost certainly will want to strip out the side-by-side references for Krool's controls since they are no longer going to be side-by-side but instead included in the executable. This get more complicated by 2 factors: 1) there may be other OCX controls the user has in the project that are not like Krool's and there is no source code version to use so the user may want to use side-by-side for the non-Krool OCX controls but not for Krool's controls. So you would need to cut Krool's references out of the resource file but not any other side-by-side references. That was a real hassle in my program. 2) The manifest extracted from a resource file may or may not be in conventional ANSI lines. It is okay to have one big long line that skips the CrLf's (LaVolpe's utility suggests doing this BTW) so you can't just treat the embedded manifest file like lines of text.
    The Resource could modify with program Resource Hacker:
    http://www.angusj.com/resourcehacker/

    Quote Originally Posted by MountainMan View Post
    - I am not a Linux guy but I found it to be nice to be able to shell straight from my utility to start an instance of VB6.exe and compile the new code. It's not that difficult to do (do you use Wine for this?) and the code is in my utility. this keeps everything nice and tidy. The user says he/she wants to have a non-OCX version and she/he gets one.
    Now you can exec "convert_ocx2stdexe.bat" and run this mutiple times. This features is enable with variable "CreateBatchWindows=TRUE"


    I'm update the script. v1.4
    Attached Files Attached Files
    Last edited by pepegriyo2016; Mar 21st, 2020 at 08:18 PM.

  10. #10

    Thread Starter
    Addicted Member
    Join Date
    Feb 2015
    Location
    Colorado USA
    Posts
    180

    Re: Krools Common Controls - Documentation and an Update/Compile Utility

    It probably is best at this point for you to make your own thread on what you've done so we don't't get everyone confused.

  11. #11
    Addicted Member
    Join Date
    Jul 2016
    Posts
    206

    Re: Krools Common Controls - Documentation and an Update/Compile Utility

    Fantastic, MountainMan! Your guide greatly reduces the hurdle of starting to use Krool's CC and explains how to do it properly. Thank you for documenting it!

  12. #12

    Thread Starter
    Addicted Member
    Join Date
    Feb 2015
    Location
    Colorado USA
    Posts
    180

    Re: Krools Common Controls - Documentation and an Update/Compile Utility

    Thanks. Most of us using VB6 are, shall we say, not newbies in programming or VB6 so it is very easy for each of us to take 20+ years of learning the intricacies of thunks, inline assembly, RtlMoveMemory, manifests, side-by-side, etc. and use them within our projects. Krool's work is brilliant but I found myself having to learn a lot of new things and things I didn't really know well in order to get his package to really work well (and it does!). The farther I got into it the more I thought that surely I can't be the only one stumbling over a lot of these concepts. Initially I started documenting it for myself but then morphed it into the user guide. I am glad you found it worthwhile.

  13. #13
    Member
    Join Date
    May 2018
    Location
    Russia
    Posts
    41

    Exclamation Re: Krools Common Controls - Documentation and an Update/Compile Utility

    MountainMan, I had to replace the #949 line of code in zVBandVBA module. Now it works fine for me:

    Code:
    If Len(OldOCXNameNoExtFlex) Then BS.Replace OldOCXNameNoExtFlex, VB6ProjectName, 1, -1, vbTextCompare
    The "Replace" method replaced the initial characters in a regular module with the project name from VB6ProjectName variable.

  14. #14

    Thread Starter
    Addicted Member
    Join Date
    Feb 2015
    Location
    Colorado USA
    Posts
    180

    Re: Krools Common Controls - Documentation and an Update/Compile Utility

    Thanks. I overlooked that. I am getting ready to issue an update that covers the last 2 versions of VBFlexGrid so I will ensure I have this correction included.

  15. #15
    Member
    Join Date
    May 2018
    Location
    Russia
    Posts
    41

    Question Re: Krools Common Controls - Documentation and an Update/Compile Utility

    MountainMan, how can I use the CommonDialog class? This is a part of OCX too, but the program uses some other logic. I have to manually add the CommonDialog.cls file to the project before using OCX2StdExe. Using the checkbox in "Options" window does not give the desired effect.

  16. #16
    Member
    Join Date
    May 2018
    Location
    Russia
    Posts
    41

    Exclamation FlexGrid 1.4 support

    Hi, MountainMan!
    Please, come back! We need you

    I've modified the Set_xx_Flex sub. Is it enough to work with FlexGrid 1.4? Now it works fine for me, but...

    VB Code:
    1. 'Changes in "zMain" module:
    2. '**************************
    3. 'Sub Set_xx_Flex()
    4. '=================
    5. 'REPLACED:
    6. '
    7. 'FROM:
    8. '  MaxOCXVerFlex = 12
    9. 'TO  :
    10.    MaxOCXVerFlex = 14
    11. 'ADDED:
    12.  
    13.    GUIDxx(14) = "{3E5D9624-07F7-4D22-90F8-1314327F7BAC}"
    14.    Verxx(14) = "1.0"
    15.    NamexxFlex(14) = "VBFLXGRD14.OCX"
    16.    'HKEY_CLASSES_ROOT\VBFLXGRD14.VBFlexGrid\Clsid
    17.    Control_GUIDFlex(1, 14) = "25017520-D6C7-473A-A17B-2DC89C44B84D"
    18.    'HKEY_CLASSES_ROOT\CLSID\{3C1D9D59-7E05-496F-9F49-0ADD34002AE5} = "VBFLXGRD14.PPVBFlexGridGeneral"
    19.    'HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{3C1D9D59-7E05-496F-9F49-0ADD34002AE5} = "VBFLXGRD14.PPVBFlexGridGeneral"
    20.    Control_GUIDFlex(2, 14) = "3C1D9D59-7E05-496F-9F49-0ADD34002AE5"
    21.    'HKEY_CLASSES_ROOT\CLSID\{3EAAE612-84B4-409B-83C1-F68BBF706DD7} = "VBFLXGRD14.PPVBFlexGridStyle"
    22.    'HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{3EAAE612-84B4-409B-83C1-F68BBF706DD7} = "VBFLXGRD14.PPVBFlexGridStyle"
    23.    Control_GUIDFlex(3, 14) = "3EAAE612-84B4-409B-83C1-F68BBF706DD7"
    24.  
    25.    GUIDxx(13) = "{841B9BEC-FA74-433C-8494-E28FE7645254}"
    26.    Verxx(13) = "1.0"
    27.    NamexxFlex(13) = "VBFLXGRD13.OCX"
    28.    'HKEY_CLASSES_ROOT\VBFLXGRD13.VBFlexGrid\Clsid
    29.    Control_GUIDFlex(1, 13) = "9FEF8CF8-A7FE-47D6-9552-7FE3FC33E417"
    30.    'HKEY_CLASSES_ROOT\CLSID\{57BFBDAF-8EF0-4553-A7B2-E69956800719} = "VBFLXGRD13.PPVBFlexGridGeneral"
    31.    'HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{57BFBDAF-8EF0-4553-A7B2-E69956800719} = "VBFLXGRD13.PPVBFlexGridGeneral"
    32.    Control_GUIDFlex(2, 13) = "57BFBDAF-8EF0-4553-A7B2-E69956800719"
    33.    'HKEY_CLASSES_ROOT\CLSID\{5F597B1A-9C13-48C4-9350-95E445E637EE} = "VBFLXGRD13.PPVBFlexGridStyle"
    34.    'HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{5F597B1A-9C13-48C4-9350-95E445E637EE} = "VBFLXGRD13.PPVBFlexGridStyle"
    35.    Control_GUIDFlex(3, 13) = "5F597B1A-9C13-48C4-9350-95E445E637EE

  17. #17

    Thread Starter
    Addicted Member
    Join Date
    Feb 2015
    Location
    Colorado USA
    Posts
    180

    Re: FlexGrid 1.4 support

    Version 2 of the documentation and the utility has been posted to post #1 at the top of this thread. Let me know if you have any problems with any of it.

  18. #18
    Member
    Join Date
    May 2018
    Location
    Russia
    Posts
    41

  19. #19
    Member
    Join Date
    May 2018
    Location
    Russia
    Posts
    41

    Re: Krools Common Controls - Documentation and an Update/Compile Utility

    Guess the riddle and get a prize ...

  20. #20

    Thread Starter
    Addicted Member
    Join Date
    Feb 2015
    Location
    Colorado USA
    Posts
    180

    Re: Krools Common Controls - Documentation and an Update/Compile Utility

    OK, I give up. What's the riddle?

  21. #21
    Member
    Join Date
    May 2018
    Location
    Russia
    Posts
    41

    Re: Krools Common Controls - Documentation and an Update/Compile Utility

    The riddle is how to make the program work. And four answers at once:

    1. Replace vb Code:
    1. For X = 1 To MaxOCXVerCCR ' UBound(mControlsCCR, 1)
    with vb Code:
    1. For X = 1 To UBound(mControlsCCR, 1)
    2. Replace vb Code:
    1. For X = 1 To MaxOCXVerFlex ' UBound(mControlsFlex, 1)
    with vb Code:
    1. For X = 1 To UBound(mControlsFlex, 1)
    3. Replace vb Code:
    1. BS.Replace OldOCXNameNoExtCCR, VB6ProjectName, 1, -1, vbTextCompare
    with vb Code:
    1. If LenB(OldOCXNameNoExtCCR) Then BS.Replace OldOCXNameNoExtCCR, VB6ProjectName, 1, -1, vbTextCompare
    4. Replace vb Code:
    1. BS.Replace OldOCXNameNoExtFlex, VB6ProjectName, 1, -1, vbTextCompare
    with vb Code:
    1. If LenB(OldOCXNameNoExtFlex) Then BS.Replace OldOCXNameNoExtFlex, VB6ProjectName, 1, -1, vbTextCompare

    That's all! You get a prize!

  22. #22

    Thread Starter
    Addicted Member
    Join Date
    Feb 2015
    Location
    Colorado USA
    Posts
    180

    Re: Krools Common Controls - Documentation and an Update/Compile Utility

    Thanks for catching the bugs. Your proposed solution is close but doesn't work.

    The offending section of code is is the procedure DoCompile from lines 952 to 970. At this point I am replacing the form references to the OCX version of the controls with the ones in the StdEXE versions of both VBCCR and VBFlexGrid to compile the controls into the program. I had caught all of the control names from the OCX version into the string array myControlsDotCCR() for VBCCR and myControlsDotFlex for VBFlexGrid and then I replace them with the equivalent names I had found in the StdEXE version. The problem is that within the past 2 months Krool has added 2 controls to the StdEXE version that are not in the OCX versino fo the controls (VirtualCombo and VListBox in VBCCR). The top value of the loop had been UBound(mControlsCCR) but this value was actually now 2 higher than the UBound of the string array containing the OCX controls so it caused an error. That's why I had commented it out. Unfortunately I had replaced it with the wrong variables. Your proposed fix is to put back the UBound values I had commented out but that won't work. They actually should be the values for LastControl for the VBCCR loop and LastfControl for the VBFlexGrid loop. These are the max values for the number of controls in each of the OCX versions.

    So basically the correct solution is to ignore the two new controls Krool added to the StdEXE version. This is not really a problem since the OCX version doesn't contain these so I don't have to replace them. That's why I can go back to using the upper bound of the original count of controls in the OCX files. BTW, I expect both of these controls to be in the OCX version 1.7 but that's not out yet and I'll deal with them then.

    So that takes care of the first 2 bugs you highlight. The other 2 I am not sure what you are driving at. You are trying to skip the call to the big string replace function by checking to ensure that the sub-string to be replaced is not a null string. In general I think that's fine but in this case, for replacing OldOCXNameNoExtCCR, the replace call won't be made if the Find function hasn't already found it. Also, I don't think there is a situation where OldOCXNameNoExtCCR can be a blank string anyway. The same arguments are made for OldOCXNameNoExtFlex.

    I fixed the first two bugs and have uploaded v2.1 with the corrected code.

  23. #23
    Member
    Join Date
    May 2018
    Location
    Russia
    Posts
    41

    Thumbs up Re: Krools Common Controls - Documentation and an Update/Compile Utility

    1. You have another riddle in the VBP file. The Trick is good.
    2. OK, I give up. Let it be so. And thank you for the good program.

  24. #24

    Thread Starter
    Addicted Member
    Join Date
    Feb 2015
    Location
    Colorado USA
    Posts
    180

    Re: Krools Common Controls - Documentation and an Update/Compile Utility

    I had used The Trick's module which enables multi-line tooltips and it worked fine on my PC. However, the reference in the .vbp file was to a location that exists on my hard drive but not in the upload. I am still learning about putting uploads out there with everything contained in the uploaded zip file. Sorry about that. Version 2.1.1 is now uploaded...

  25. #25

    Thread Starter
    Addicted Member
    Join Date
    Feb 2015
    Location
    Colorado USA
    Posts
    180

    Re: Krools Common Controls - Documentation and an Update/Compile Utility

    Version 2.3 is at the bottom of post #1. Among several other improvements, the biggest change is that it supports Krool's OCX version 1.7.

  26. #26
    Junior Member
    Join Date
    Nov 2018
    Posts
    19

    Re: Krools Common Controls - Documentation and an Update/Compile Utility

    Quote Originally Posted by MountainMan View Post
    Version 2.3 is at the bottom of post #1. Among several other improvements, the biggest change is that it supports Krool's OCX version 1.7.
    Excuse me:
    Version 2.3: Compilation cannot be completed when there are custom controls, and an error: File not found
    Compiler Results:

    File not found:'D:\vbHelperEx\Krool\Test\StdEXE\ctlControl1.ctl'

    Version 2.2 can be compiled successfully

    Attachment 178515
    CompilationTest.zip

  27. #27

    Thread Starter
    Addicted Member
    Join Date
    Feb 2015
    Location
    Colorado USA
    Posts
    180

    Re: Krools Common Controls - Documentation and an Update/Compile Utility

    smileyoufucn,

    Thanks for catching the bug. I had missed 2 "=" signs. It only affected projects with self-declared USERCONTROLs and PROPERTYPAGEs. Fixed now. your simple project compiles now.

  28. #28
    Junior Member
    Join Date
    Nov 2018
    Posts
    19

    Re: Krools Common Controls - Documentation and an Update/Compile Utility

    Excuseme

    MountainMan

    Thank you for your update

    Version 2.3.1:Error

    if Resources.res file path = APP.Path\Res\Resources.res then

    Compiler Results:
    1、Error: Resource file 'D:\vbHelperEx\Krool\CompilationTest\CompilationTest-2\StdEXE\Res\Resources.res' in the .vbp file does not exist!
    2、Other files referenced by the project (*.dll or *.ocx…For example: the referenced vbRichClient5.dll file) are not copied to the StdEXE path



    Name:  Res-NG.jpg
Views: 1039
Size:  33.2 KB

    Name:  NG.jpg
Views: 994
Size:  25.7 KB

    Name:  CopyTo.jpg
Views: 990
Size:  27.7 KB

    CompilationTest-2.zip

    thank you very much!

  29. #29
    Member
    Join Date
    May 2018
    Location
    Russia
    Posts
    41

    Lightbulb Re: Krools Common Controls - Documentation and an Update/Compile Utility

    Hello, MountainMan! Let's improve your documentation a little bit? I don't want to create a new thread for it. There are two files in the attachment:

    GetVbDescr.bas
    This is a ready to use program (Sub Main) without GUI. It creates an mdb database with descriptions of the control's subs, events, properties, etc. All you need to use it is to set up the sSrcPath constant (path to "Builds" folder) and run it. The program will create a vbccr.mdb database with all the descriptions.

    vbccr.pdf
    This is a standard Microsoft Access report. You can use it as a help file.

    I will improve this program in the future. I want to add a GUI and a translation functionality. So we will be able to automatically translate descriptions within the new versions of controls. I will translate it into Russian.

    GetVbDescr.bas

    vbccr.pdf

  30. #30

    Thread Starter
    Addicted Member
    Join Date
    Feb 2015
    Location
    Colorado USA
    Posts
    180

    Re: Krools Common Controls - Documentation and an Update/Compile Utility

    smileyoufucn,

    For OCX files, if they are registered with Windows and then referenced in the vbp file I dno't copy them since they are still registered with Windows int he original spot. Is the OCX file you are referencing not registered?

    Are the DLL files also not registered with Windows as ActiveX controls? If not, are they referenced anywhere in the vbp file or the res file?

    For the resource file, I changed the reference to it from a relative path in the original vbp file to the same resource file but in the new resource file in StdEXE it has a new relative reference to the RES file. That way, if things were referenced in the RES fiel they would still be referenced in the same RES file. It looks like you want the sub-folder copied over (\Res in your example). How would I know what to copy from this folder or do you want the whole folder copied? Also are there any references within the RES file in the \Res folder that will now be incorrect in the new copy of the Res folder in the new location?

  31. #31
    Member
    Join Date
    May 2018
    Location
    Russia
    Posts
    41

    Question Re: Krools Common Controls - Documentation and an Update/Compile Utility

    MountainMan, can you help me with translation of descriptions? Please, look at the screenshot. How could it be so? I have changed (translated) the "Attribute Left.VB_Description" value in the CheckBoxW.ctl file. Then I opened the ComCtlsDemo.vbp project and got two different descriptions of one property.

    Name:  ScreenShot001.jpg
Views: 942
Size:  47.2 KB

  32. #32

    Thread Starter
    Addicted Member
    Join Date
    Feb 2015
    Location
    Colorado USA
    Posts
    180

    Re: Krools Common Controls - Documentation and an Update/Compile Utility

    Nouyana,

    I think I should defer to Krool on this one since he wrote the controls. Post your message here.

  33. #33
    Junior Member
    Join Date
    Nov 2018
    Posts
    19

    Re: Krools Common Controls - Documentation and an Update/Compile Utility

    Quote Originally Posted by MountainMan View Post
    Nouyana,

    I think I should defer to Krool on this one since he wrote the controls. Post your message here.

    I was too busy the other day and did not reply in time. I am very sorry!
    Thank you MountainMan for your help!

    1. The previous OCX and DLL files are indeed not registered, but the manifest file "XXX.EXE.manifest" is used. After the registration is successful, use "OCX2StdExe2.3.1" to compile and it is already normal;
    2. The resource file "Recurso.res" contains image files and is placed in a relative path. The compilation fails, "File not found: Recurso.res" (Path ....\StdEXE\Recurso.res Not exist)


    [Prompt for compilation failure]
    Compiler Results:

    File not found:'Recurso.res'
    One or more attributes in'D:\vbHelperEx\Src\PNG en ImageList\StdEXE\Proyecto2.vbp' are wrong. Some or all properties are set incorrectly.

    Below is the demo file:


    PNG en ImageList_VBCCR_CompileTest.zip

    Name:  CompilationFailed.jpg
Views: 892
Size:  27.2 KB

    Name:  FileNotFound.jpg
Views: 885
Size:  25.7 KB

  34. #34
    Junior Member
    Join Date
    Nov 2018
    Posts
    19

    Re: Krools Common Controls - Documentation and an Update/Compile Utility

    Compilation is normal in IDE, an error occurs when compiling with "OCX2StdExe2.3.1"

    Compiler Results:

    File'D:\vbHelperEx\Src\VBCCR17\Login\StdEXE\frmToolBarTemp.frm' compilation error, line 4: user-defined type is not defined
    'ToolBarTest.exe' failed to compile.

    Compiler Results:

    Loading error. For details, see'D:\vbHelperEx\Src\VBCCR17\Login\StdEXE\ucMyUserControl1.log'
    File'D:\vbHelperEx\Src\VBCCR17\Login\StdEXE\frmToolBarTemp.frm' compilation error, line 3: user-defined type is not defined
    'ToolBarTest.exe' failed to compile.

    ToolBarTest.zip

  35. #35

    Thread Starter
    Addicted Member
    Join Date
    Feb 2015
    Location
    Colorado USA
    Posts
    180

    Re: Krools Common Controls - Documentation and an Update/Compile Utility

    Quote Originally Posted by smileyoufucn View Post
    Compilation is normal in IDE, an error occurs when compiling with "OCX2StdExe2.3.1"

    Compiler Results:

    File'D:\vbHelperEx\Src\VBCCR17\Login\StdEXE\frmToolBarTemp.frm' compilation error, line 4: user-defined type is not defined
    'ToolBarTest.exe' failed to compile.

    Compiler Results:

    Loading error. For details, see'D:\vbHelperEx\Src\VBCCR17\Login\StdEXE\ucMyUserControl1.log'
    File'D:\vbHelperEx\Src\VBCCR17\Login\StdEXE\frmToolBarTemp.frm' compilation error, line 3: user-defined type is not defined
    'ToolBarTest.exe' failed to compile.
    I apologize for taking so long to reply. I have had some serious medical issues I had to fight through. I have just released an update to this utility which addresses your problem as well as many others. Please see post #1.

    You problem was twofold: 1)you defined one of Krool's controls in a .BAS module. I wasn't checking for this and it was compounded by the fact that the control name was defined in a string variable. 2) You used one of Krool's controls inside of your own control. I did not account for that occurrence. Both are fixed. I successfully compiled your attachment with the update.

  36. #36
    Junior Member
    Join Date
    Nov 2018
    Posts
    19

    Re: Krools Common Controls - Documentation and an Update/Compile Utility

    Dear MountainMan, thank you very much for your help!
    Sorry for the late reply! My recent work is very busy and I haven't tested it in time. Today, I took the time to test, and after selecting the required controls, the "ToolBarTest" project was successfully compiled. This is of great help to the projects I developed.


    Compiled successfully 1
    Name:  编译成功.jpg
Views: 152
Size:  34.2 KB

    Compiled successfully 2
    Name:  编译成功2.jpg
Views: 156
Size:  17.5 KB

    The version number has not been updated:
    Name:  版本号.jpg
Views: 153
Size:  21.1 KB

    Many thanks!
    Last edited by smileyoufucn; May 7th, 2021 at 09:41 AM.

Tags for this Thread

Posting Permissions

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



Click Here to Expand Forum to Full Width