Page 1 of 3 123 LastLast
Results 1 to 40 of 82

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

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2015
    Location
    Colorado USA
    Posts
    271

    Krools Common Controls - Documentation and an Update/Compile Utility

    Version 3.5 is available for download at the bottom of this post. The program now handles all versions of VBCCRxx,OCX up through the current v1.8 and it handles all VBFLXGRDxx.OCX versions up through the just-released v1.7.

    Krool has been developing a set of common controls replacements since 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.7 (just to complicate matters the FlexGrid controls have gone from 1.0 to 1.6). 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 3.5 of this utility.Attachment 192022
    Attached Files Attached Files
    Last edited by MountainMan; Jun 19th, 2024 at 08:27 AM. Reason: Now works with VBCCRv1.8

  2. #2
    Fanatic Member
    Join Date
    Aug 2016
    Posts
    691

    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
    Hyperactive Member
    Join Date
    Feb 2015
    Location
    Colorado USA
    Posts
    271

    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
    Fanatic Member
    Join Date
    Aug 2016
    Posts
    691

    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
    50

    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
    Hyperactive Member
    Join Date
    Feb 2015
    Location
    Colorado USA
    Posts
    271

    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
    Hyperactive Member
    Join Date
    Feb 2015
    Location
    Colorado USA
    Posts
    271

    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
    50

    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
    Hyperactive Member
    Join Date
    Feb 2015
    Location
    Colorado USA
    Posts
    271

    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
    230

    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
    Hyperactive Member
    Join Date
    Feb 2015
    Location
    Colorado USA
    Posts
    271

    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
    Hyperactive Member
    Join Date
    May 2018
    Location
    Russia
    Posts
    343

    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
    Hyperactive Member
    Join Date
    Feb 2015
    Location
    Colorado USA
    Posts
    271

    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
    Hyperactive Member
    Join Date
    May 2018
    Location
    Russia
    Posts
    343

    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
    Hyperactive Member
    Join Date
    May 2018
    Location
    Russia
    Posts
    343

    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
    Hyperactive Member
    Join Date
    Feb 2015
    Location
    Colorado USA
    Posts
    271

    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
    Hyperactive Member
    Join Date
    May 2018
    Location
    Russia
    Posts
    343

  19. #19
    Hyperactive Member
    Join Date
    May 2018
    Location
    Russia
    Posts
    343

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

    Guess the riddle and get a prize ...

  20. #20

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2015
    Location
    Colorado USA
    Posts
    271

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

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

  21. #21
    Hyperactive Member
    Join Date
    May 2018
    Location
    Russia
    Posts
    343

    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
    Hyperactive Member
    Join Date
    Feb 2015
    Location
    Colorado USA
    Posts
    271

    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
    Hyperactive Member
    Join Date
    May 2018
    Location
    Russia
    Posts
    343

    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
    Hyperactive Member
    Join Date
    Feb 2015
    Location
    Colorado USA
    Posts
    271

    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
    Hyperactive Member
    Join Date
    Feb 2015
    Location
    Colorado USA
    Posts
    271

    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
    Hyperactive Member
    Join Date
    Feb 2015
    Location
    Colorado USA
    Posts
    271

    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: 5383
Size:  33.2 KB

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

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

    CompilationTest-2.zip

    thank you very much!

  29. #29
    Hyperactive Member
    Join Date
    May 2018
    Location
    Russia
    Posts
    343

    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
    Hyperactive Member
    Join Date
    Feb 2015
    Location
    Colorado USA
    Posts
    271

    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
    Hyperactive Member
    Join Date
    May 2018
    Location
    Russia
    Posts
    343

    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: 5094
Size:  47.2 KB

  32. #32

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2015
    Location
    Colorado USA
    Posts
    271

    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: 5874
Size:  27.2 KB

    Name:  FileNotFound.jpg
Views: 5202
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
    Hyperactive Member
    Join Date
    Feb 2015
    Location
    Colorado USA
    Posts
    271

    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: 4413
Size:  34.2 KB

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

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

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

  37. #37
    Member Dragokas's Avatar
    Join Date
    Aug 2015
    Location
    Ukraine
    Posts
    740

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

    Thanks, MountainMan for this fantastic tool and docs!
    And thanks to Krool for continue maintaining this huge project.

    MountainMan, can I ask you please ability to auto-save OCX2StdExe options on exit, like last project selected, VB6 base folder & Base folder of ComCtlsDemo?
    I used your tool first time, and I found some things, you may want to improve:
    - When VBCR run the first time, it has no registration of "OLEGuids.tlb", and your tool msgbox me a hint "... to use regsvr32", however, AFAIK, it is not applicable for tlb. I used my RegTLib instead. So, that message looks a bit confusing.
    - When I select Options => Special => Select "ListView" only. I have a compilation error, because none of additional include files was selected by default. Can you auto-select a minimal required include files (I mean Common.bas, ISubClass.cls e.t.c.) in order to compile the project successfully? Or at least select all of them by default on first tool run.
    - When I select only these includes "Common.bas" + "VTableHandle.bas" + "ISubClass.cls" + ListView in special, during compilation, the tool reported me that "project compiled OK", however project is not compiled. No exe. My source project has no code (just ListView control + OCX reference). So, error checking could be improved. BTW, when I un-select other includes, OCX2StdExe correctly displays a error message for me that happened during compilation.

    Again, very cool project!
    Good health to you!
    Malware analyst, VirusNet developer, HiJackThis+ author || my CodeBank works

  38. #38

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2015
    Location
    Colorado USA
    Posts
    271

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

    Alex,

    Do you have a file in the folder with my utility named OCX2StdExe.ini? That file holds all of the information you would like to save.

    When I decided to use INI files I had to pick where to put the INI file. The simplest place to put the file is in the same folder where your project file is. However, as you know, if you have compiled it and put it into your Program Files set of folders, Windows doesn't let you write to anything there without a UAC elevation. If my utility determines you are running in the IDE it wills save the INI file in your project folder. However, if you are running the compiled program it can either be there or in the Apps folder. Look at the code starting at line 2007 in mVB6Core.bas and you will find a public variable named CompiledUseAppFolder which sets whether the project folder or the Apps folder is used. It is initially left False so by default the EXE file will use the project folder. Did that address your problem or do you think something else is going on?

    I'll address your other concerns shortly.

  39. #39
    Member Dragokas's Avatar
    Join Date
    Aug 2015
    Location
    Ukraine
    Posts
    740

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

    Hi, and thanks for the detailed explanation.
    No, I'm using folders with full access for current user.
    My issue was: I just overlooked a button "Save & Exit". Now, settings are saved OK.

    Quote Originally Posted by MountainMan
    However, if you are running the compiled program it can either be there or in the Apps folder.
    Well, I decided to test, I just moved OCX2StdExe.ini from OCX2StdExe.exe's folder to my project's folder. Run OCX2StdExe, select my .vbp file, but it doesn't automatically recognize ini file next to vbp.

    Also I noticed, when your app ran as non-elevated, KillW => SHFileOperation is failed on my system with code 120 (DE_ACCESSDENIEDSRC, Security settings denied access to the source), when it is used with FOF_ALLOWUNDO (recycle) flag. Normal delete operation is working OK. Possible improvement is an option to delete file instantly (without recycle bin).

    Also, when your tool run DoCompile => ShellW, it always pass AdminYes, every time asking me for elevation. Dunno, is it by intention. But, it is not needed for all projects. AsAdmin:=AdminOnlyIfNeeded was enough for me. Surely, it's on your own, do you want to leave it as is, or just maybe add some option in menu, which looks more preferred way as for me.

    Also, I tested all command line option combinations, and this one "/s2 /a-" causes error on MCIWnd.ctl, Line 1383 - User-Defined type not defined.

    All at all, I absolutely happy with your project, and especially an ability to compile silently.

    Just curious, in which kind of projects you used supporting API-wrappers, and did you publish them as a separate framework? They're looks to have a lot of functionality, error checking with textual description, unicode, long path and VBA64 support. I did some similar, but yours looks a really intensive.
    Malware analyst, VirusNet developer, HiJackThis+ author || my CodeBank works

  40. #40

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2015
    Location
    Colorado USA
    Posts
    271

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

    I didn't know you could run VB6.EXE, even the commandline version, without elevating. I never tried it (yes, I know all about the word "assume"...).

    I probably wasn't clear on the location of the INI file. Absent setting CompiledUseAppsFolder = True, the program looks for the INI file in the same folder as the EXE itself (I said the project file location but that was inaccurate). If you had set CompiledUseAppsFolder was set True then the program looks for the INI file in "C:\Users\{username}\AppData\Local\Ocs2StdExe" which is where we are supposed to put program data in Vista+ instead of "C:Program Files" or "C:Program Files (x86)".

    I will check to see what is causing the error with the commandline options.

    By training I am a chemical engineer and I have never written commercial software. I have written a fair amount of VBA code in Excel and about 10 years ago I picked up 2 copies of VB6 because it can produce EXE's and is so similar to VBA. I started playing with API calls to deal with Unicode and long paths and then when Office 2010 came out with its 64-bit version that's when I adapted everything to run on 32 or 64-bit via conditional compilation constants. Since I am mainly a hobbyist I can take the time to make libraries and optimize everything. The only code I have ever used from someone else is LaVolpe's manifest code in this program. When I figured out that I needed to address manifests it looked like it was going to take some time and I got in a hurry and his code worked. I've been working off and on for a decade on a pretty sophisticated file manager and I am within a couple of weeks of putting it in the CodeBank. It is as fast as anything on the market and can handle millions of files. There is a VB6 and a VBA version & I think many people will be surprised at how well it works.

Page 1 of 3 123 LastLast

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