-
Nov 7th, 2017, 12:36 PM
#1841
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by Hosam AL Dein
6- Set all class modules instances to GlobalMultiuse.
Wrong. Put all classes to "PublicNotCreatable".
Except CommonDialog.cls. This shall be "MultiUse". (Not "GlobalMultiUse")
Also some classes should kept "Private" such as Enumeration.cls, VTableSubclass.cls etc.
So an advise to put everything on GlobalMultiUse is not so good.
For the other stuff in WindowProcUserControlDesignMode it is a safety to remove subclassing in IDE at DesignTime. In the OCX this is not needed. If it keeps there it can even produce glitches. You had once an issue with the CommandButtonW that it went blank on certain steps. This was one case of that.
Anyhow, you can proceed how you want..
Last edited by Krool; Nov 7th, 2017 at 12:45 PM.
-
Nov 7th, 2017, 06:53 PM
#1842
Addicted Member
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by Krool
Wrong. Put all classes to "PublicNotCreatable".
Except CommonDialog.cls. This shall be "MultiUse". (Not "GlobalMultiUse")
Also some classes should kept "Private" such as Enumeration.cls, VTableSubclass.cls etc.
So an advise to put everything on GlobalMultiUse is not so good.
For the other stuff in WindowProcUserControlDesignMode it is a safety to remove subclassing in IDE at DesignTime. In the OCX this is not needed. If it keeps there it can even produce glitches. You had once an issue with the CommandButtonW that it went blank on certain steps. This was one case of that.
Anyhow, you can proceed how you want..
thanks a lot krool for correction . Of course I will proceed in the way you provided . I will re-write these steps again until we come to the ideal way
-
Nov 8th, 2017, 03:28 PM
#1843
Re: CommonControls (Replacement of the MS common controls)
OCX Version 1.5 now released.
-
Nov 14th, 2017, 08:22 AM
#1844
Lively Member
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by Krool
OCX Version 1.5 now released.
Thanks for the new release. Im using these controls in a new project. really appreciate your time and effort in these controls!
Was wondering if there would be any chance of being able to add a color option for tool bar button caption text.
thanks again.
-
Nov 14th, 2017, 12:34 PM
#1845
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by vbLewis
Thanks for the new release. Im using these controls in a new project. really appreciate your time and effort in these controls!
Was wondering if there would be any chance of being able to add a color option for tool bar button caption text.
thanks again.
You must have overlooked it. There is a ForeColor property available.
Code:
ToolBar1.Buttons(1).ForeColor
This can also be defined at design-time trough the property page.
-
Nov 14th, 2017, 05:23 PM
#1846
Lively Member
Re: CommonControls (Replacement of the MS common controls)
ahh ok. yes i missed it, i was looking under the color tab and in the main toolbar properties. The fact that it is per button makes it even cooler! Thankyou!
Edit: I couldnt get any of the custom foreground colors to 'stick' from the property pages, only set from code, so far for toolbar button and status bar panels. is this by design?
Last edited by vbLewis; Nov 14th, 2017 at 06:11 PM.
-
Nov 18th, 2017, 01:40 PM
#1847
Re: CommonControls (Replacement of the MS common controls)
Source code for both Std-EXE and ActiveX version has been put on GitHub. Link can be found on initial post.
Originally Posted by vbLewis
I couldnt get any of the custom foreground colors to 'stick' from the property pages, only set from code, so far for toolbar button and status bar panels. is this by design?
For me it works, so I cannot replicate your problem. What do you mean exactly? Please describe step-by-step.
Last edited by Krool; Nov 18th, 2017 at 02:28 PM.
-
Nov 20th, 2017, 03:59 PM
#1848
Lively Member
Re: CommonControls (Replacement of the MS common controls)
Add toolbar control to form -> click on 'custom' to open custom property page dialog -> add toolbar button -> click on colored command button to change button foreground color -> select new color for button caption -> click OK -> color dialog closes and color on command button in property sheet stays the same as it was. same for font, cannot change size.
are you calling 'propertychanged()' when property is changed in in property sheet? it may be a storage bag permission problem on my end too.
when i use the normal toolbar properties tab in the IDE to change font, font size is changed and works ok. but of course it doesnt edit colors for a single button, only the entire toolbar. I can set color for individual buttons from code and works good that way.
-
Nov 21st, 2017, 01:39 PM
#1849
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by vbLewis
Add toolbar control to form -> click on 'custom' to open custom property page dialog -> add toolbar button -> click on colored command button to change button foreground color -> select new color for button caption -> click OK -> color dialog closes and color on command button in property sheet stays the same as it was. same for font, cannot change size.
are you calling 'propertychanged()' when property is changed in in property sheet? it may be a storage bag permission problem on my end too.
when i use the normal toolbar properties tab in the IDE to change font, font size is changed and works ok. but of course it doesnt edit colors for a single button, only the entire toolbar. I can set color for individual buttons from code and works good that way.
Update released. Please test again. Thanks
-
Nov 23rd, 2017, 05:34 AM
#1850
Fanatic Member
Re: CommonControls (Replacement of the MS common controls)
New Pager Problem
Try with the attached.
Pager3.zip
The problem is, when I modify a Pager's buddy, then the buddy gets clipped.
It is not with a PictureBox (discussed before), but with a standard UC.
EDIT:
A PictureBox as the buddy works ok with the workaround described in #1820.
Now I use this approach instead of using a UC as the buddy.
Last edited by Karl77; Nov 23rd, 2017 at 08:06 AM.
-
Nov 24th, 2017, 04:07 PM
#1851
Hyperactive Member
Re: CommonControls (Replacement of the MS common controls)
Krool,
I was just working with you VBFlexGrid Demo system and now that you have an OCX version I thought I would make the same sample program using the OCX file. I decided to make the two forms with your VBCCRxx OCX files and I just noticed that you didn't include a PictureBox in your VBCCRxx controls. Was that intentional and if so, why? I assume I can use the ImageList control to achieve the same results and I am guessing that's why you didn't do one for VBCCRxx but I thought I would ask.
-
Nov 25th, 2017, 12:29 PM
#1852
Re: CommonControls (Replacement of the MS common controls)
MountainMan,
PictureBox replacement is not needed and there are also better alternatives, e.g. AlphaImageControl.
ImageList was necessary to work together with the controls.
-
Dec 4th, 2017, 07:47 AM
#1853
Registered User
Re: CommonControls (Replacement of the MS common controls)
Want to report a problem
RichTextBox can't do anything to clear up, if SelProtected is being used or the document is already contain SelProtected Text
BTW, thank you for this wonderful control!
-
Dec 7th, 2017, 02:02 PM
#1854
Fanatic Member
Re: CommonControls (Replacement of the MS common controls)
TABSTRIP QUESTION
The TabClick events is fired immediately when the mouse button is down on the tab.
In other controls, like CommandButtonW, the click events is not fired until the mouse button is released over the control.
Any chance to improve this behavior for the TabStrip?
Karl
-
Dec 8th, 2017, 08:54 AM
#1855
Fanatic Member
Re: CommonControls (Replacement of the MS common controls)
SUBCLASSING QUESTION (again)
In post #1814 Dex told me how to use the subclassing provided by VBCCR.
This works quite well.
But when we use the OCX and not the EXE version, this can't be done.
ComCtlsSetSubclass/ComCtlsRemoveSubclass is not avaiable.
Krool, is it possible to use your subclassing along with the OCX version?
And if, how?
-
Dec 9th, 2017, 04:33 AM
#1856
Re: CommonControls (Replacement of the MS common controls)
Update released.
The IDE (does not effect compiled exe) will not crash anymore when using VBCCRxx.OCX and VBFLXGRDxx.OCX in paralell. (Std-EXE version not concerned)
-
Dec 10th, 2017, 09:04 AM
#1857
Addicted Member
Re: CommonControls (Replacement of the MS common controls)
-
Dec 10th, 2017, 01:34 PM
#1858
Fanatic Member
Re: CommonControls (Replacement of the MS common controls)
Hosam, do you use the most recent version or the former version?
If you use the most recent version, can you try the same with yesterday`s version?
Or the other way around?
Do you get the same result when you use the OCX?
Last edited by Karl77; Dec 10th, 2017 at 01:54 PM.
-
Dec 10th, 2017, 06:34 PM
#1859
Addicted Member
Re: CommonControls (Replacement of the MS common controls)
thanks karl , here is the test for the ocx
https://youtu.be/sPcpaampZa4
-
Dec 10th, 2017, 06:53 PM
#1860
Addicted Member
Re: CommonControls (Replacement of the MS common controls)
here is a test with the most recent ocx and it is the same result
https://youtu.be/uooZxHBKV24
-
Dec 11th, 2017, 02:48 AM
#1861
Fanatic Member
Re: CommonControls (Replacement of the MS common controls)
Hosam
I think it will be good if you upload the projects in question here.
So that we and especially Krool can retrace the error.
Videos are not so very helpful in this case.
-
Dec 11th, 2017, 02:59 AM
#1862
Addicted Member
Re: CommonControls (Replacement of the MS common controls)
I think it is not a problem of code karl . As in the videos , the same code runs successfully in a time and causes vb to crash in another time . Also , the STDexe project never run successfully with me . Once I open it , or just try to view the FrmMain , Vb crashes . This of course is not the case for any of the members here as almost no one reported this problem . So , I think it is not a matter of code . It might be something related to registry entries or binary conflict or something in VB6 IDE itself . This was the reason I uploaded these videos : to see what is wrong in my case . But I will upload the project also . It might be something common . Thanks karl .
Edit 1 :
the project source code . Just put the database in the D:\ partition and add a reference to ado 2.5 library and of course VBCCR 1.5 OCX
test.zip.docx
Last edited by Hosam AL Dein; Dec 11th, 2017 at 03:07 AM.
Reason: add an attachment
-
Dec 11th, 2017, 05:52 AM
#1863
Fanatic Member
Re: CommonControls (Replacement of the MS common controls)
Hosam
Do you run the VB6 IDE with admin rights?
From the videos, I don't see the UAC dialog coming up.
I tried to test here with VBCCR15, but it seems I don't have the correct database tools installed.
Unfortunately, I can't run the project using the data connection.
When I comment out all the database related stuff, then the project runs well in the IDE.
And does never crash.
A remark:
It is good to use Option Explicit in your code, it can help a lot.
Last edited by Karl77; Dec 11th, 2017 at 06:16 AM.
-
Dec 11th, 2017, 08:00 AM
#1864
Addicted Member
Re: CommonControls (Replacement of the MS common controls)
yes karl vb6 runs with admin rights .
and I used option explicit and same results came up
For the database , I use MS access 2010 . It is necessary to setup it and run the database code to exactly simulate the case I have
-
Dec 15th, 2017, 04:37 AM
#1865
New Member
Re: CommonControls (Replacement of the MS common controls)
Hi, would this work for 64-bit Word / Excel?
Do you have anything to replace OWC11, again for 64-bit Word?
Thanks
-
Dec 15th, 2017, 10:20 AM
#1866
Addicted Member
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by MMcC
Hi, would this work for 64-bit Word / Excel?
Do you have anything to replace OWC11, again for 64-bit Word?
Thanks
I believe it would not. Office x64 is not compatible with 32bit COM
beside for your information, Microsoft does recommand to NOT install x64 version of Office UNLESS:
"you are opening image or database of more then 2gb"
ref.:
https://support.office.com/en-us/art...e-6c6f49b8d261
People tend to think x64 version are better and faster. This is absolutely not true with the exception of file OVER 2gb
wich very FEW people in the whole world use (news editors is a good example of such users)
I have a very large Database in access with history of more then 100 000 records and the database has a file of 3mb
The biggest I ever saw in Office was a 240mb file from a powerpoint for the end of school (prom) newspaper. there were over
thousand images in it. we're far from the 2gb limit
-
Dec 15th, 2017, 11:27 AM
#1867
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by VbNetMatrix
I believe it would not. Office x64 is not compatible with 32bit COM
beside for your information, Microsoft does recommand to NOT install x64 version of Office UNLESS:
"you are opening image or database of more then 2gb"
ref.:
https://support.office.com/en-us/art...e-6c6f49b8d261
The project is limited to 32 bit.
Even in Access 2013 format x64 the database limit is 2GB. So even no advantage on that..
And the 4GB memory limitation for 32 bit is not an argument. Every 32 bit process can have 4gb allocation. (Not in total allocation; per process allocation)
So who want to use more than 4gb of ram in an office instance?
My advise: go back to 32 bit office.
-
Dec 15th, 2017, 11:40 AM
#1868
New Member
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by Krool
The project is limited to 32 bit.
Even in Access 2013 format x64 the database limit is 2GB. So even no advantage on that..
And the 4GB memory limitation for 32 bit is not an argument. Every 32 bit process can have 4gb allocation. (Not in total allocation; per process allocation)
So who want to use more than 4gb of ram in an office instance?
My advise: go back to 32 bit office.
The application we're running in 32-bit is hitting the memory limit and so we're getting Out Of Memory errors. It's a very complex planning application with a big updateable data cube being presented in an embedded worksheet in Word. We've slimmed it down as much as we can but it's right up against the limit. Hence we are looking at the possibility of 64-bit which doesn't have the 4Gb memory limitation.
Is there any way we can get multiple processes running from within the one VBA app?
-
Dec 15th, 2017, 11:55 AM
#1869
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by MMcC
The application we're running in 32-bit is hitting the memory limit and so we're getting Out Of Memory errors. It's a very complex planning application with a big updateable data cube being presented in an embedded worksheet in Word. We've slimmed it down as much as we can but it's right up against the limit. Hence we are looking at the possibility of 64-bit which doesn't have the 4Gb memory limitation.
Is there any way we can get multiple processes running from within the one VBA app?
I have made the experience that x64 office also do raise "out of memory". Reason could be some virtual memore pages and not related to physical memory at all.
-
Dec 15th, 2017, 12:00 PM
#1870
New Member
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by Krool
I have made the experience that x64 office also do raise "out of memory". Reason could be some virtual memore pages and not related to physical memory at all.
So what approach would you recommend to avoid / reduce / manage the out of memory errors?
-
Dec 15th, 2017, 01:30 PM
#1871
Hyperactive Member
Re: CommonControls (Replacement of the MS common controls)
MMcC, it is fairly easy to get multiple apps running from one VBA application. VBA is inherently single-threaded but using shell you can start as many new process as you have memory for. In addition, you can communicate between the separate processes. For example, I have a file manager program that is written in Excel that has the option of doing the specified file operation(s) such as copy, move, rename or delete files and/or folders within the currently running instance of Excel or it can spawn a new instance of Excel and do them separate from the current instance. In fact, you can spawn as many of these as you want. I have also seen this technique used to do many web searches at one time. Yes there is some overhead by starting new instances of Excel, Access, Word, etc. but it is really not that much (maybe 20mb) in today's multiple gigabyte systems. It is a handy way of effectively multi-tasking from within VBA (same code works in VB6 too). I could upload some code to show you how to do this if you are interested.
-
Dec 15th, 2017, 01:46 PM
#1872
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by MMcC
The application we're running in 32-bit is hitting the memory limit and so we're getting Out Of Memory errors.
“Out Of Memory” Does Not Refer to Physical Memory might offer some insight on why you're getting that error.
-
Dec 15th, 2017, 03:46 PM
#1873
Addicted Member
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by MMcC
The application we're running in 32-bit is hitting the memory limit and so we're getting Out Of Memory errors. It's a very complex planning application with a big updateable data cube being presented in an embedded worksheet in Word. We've slimmed it down as much as we can but it's right up against the limit. Hence we are looking at the possibility of 64-bit which doesn't have the 4Gb memory limitation.
Is there any way we can get multiple processes running from within the one VBA app?
if your program is using more then 4gb ram memory (in ANY scenario), it is most likely a memory leak issue.
in c# for example, lot of people are using COM component without using the garbage collector wich is MANDATORY when using COM component in Managed code. More to that, while using COM, the simple rule that apply is "never use 2 dot" (meaning don't use this.property.property) because it will cause a memory leak while the .NET do this in memory:
TempObject= this.property
userobject = TempObject.property (equivalent to this.property.property )
the TempObject will reside in memory even if you use the GC collector and then you got memory leak.
you're talking about using worksheet in Word, (this is using COM component) plz check your code for double dot and GC collector properly used.
Krool: didn'T intended to hijack your thread with this answer, if you think it was innapropriate, just tell me I'll refrain myself in the futur.
Last edited by VbNetMatrix; Dec 15th, 2017 at 03:49 PM.
Reason: misspelled user name
-
Dec 19th, 2017, 01:47 PM
#1874
Addicted Member
Re: CommonControls (Replacement of the MS common controls)
Any suggestions for my question guys ?
-
Dec 19th, 2017, 03:04 PM
#1875
Fanatic Member
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by Hosam AL Dein
Any suggestions for my question guys ?
Briefly watched your video. I think that it is not the grid component, but the ADO which causes the IDE crash. Solution is to properly close ADO connection and set the ADO object to nothing (by VB code) before closing application.
fex...
Code:
'in form QueryUnload routine
DB.Close 'close db connection
Set DB = Nothing
'or
Set rs = Nothing
Set cmd.ActiveConnection = Nothing
Set cmd = Nothing
More information
https://docs.microsoft.com/en-us/sql...ose-method-ado
https://docs.microsoft.com/en-us/sql...ods-example-vb
http://www.vbforums.com/showthread.p...ado-connection
-
Dec 19th, 2017, 05:18 PM
#1876
Addicted Member
Re: CommonControls (Replacement of the MS common controls)
double post for some server reason...
Last edited by VbNetMatrix; Dec 19th, 2017 at 05:31 PM.
-
Dec 19th, 2017, 05:20 PM
#1877
Addicted Member
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by Hosam AL Dein
There is a few thing I have noticed but it is really simple Vb6 programming rules that are not applied.
one of the is your declaration with the NEW keyword.
in Vb6 you must NEVER declare a variable with a NEW keyword, this has been documentated at least a hundred time
it mess up the memory in many ways.
always prefers the method:
Dim YourObject as ...
Set YourObject = new ...
then, never forget to DESTROY the object when you are done with it.
Set YourObject = Nothing
(you're not doing it so you got a memory leak there that in time will crash the IDE while debugging)
same thing with the WITH keyword, it's better to avoid it when not necessary, I missed why you really need the first WITH.
aside from that, you didn't showed what reference object you are using for the RecordSet, there is many version of the MDAC and only the 2.8 and 6.1 (6.0) are stable for Win7+ if you're using anything different, it might as well be your problem
Microsoft recommend to use only the 6.0 for Win7+
if you could post a non working project, it would be easier for diagnose. as for me, I didn't use that component for year because I created my own component based on 6.0
I doubt it has anything to do with Krool control. did you tested your code with regular control ?
I also noticed the bug you got when you open Vb6, the only time I saw this bug was with a Custom made USB portable version for Vb6 and it contain a Trojan (virus)
I would fix your installation before attempting to search for gremlins.
-
Jan 3rd, 2018, 01:45 PM
#1878
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by Karl77
TABSTRIP QUESTION
The TabClick events is fired immediately when the mouse button is down on the tab.
In other controls, like CommandButtonW, the click events is not fired until the mouse button is released over the control.
Any chance to improve this behavior for the TabStrip?
It seems that behavior is wanted by the TabStrip control. It's done by comctl32.dll. (TCN_SELCHANGE)
The only workaround would be to handle MouseUp event and perform a HitTest.
Edit: you certainly also need to handle TabBeforeClick and pass True to the 'Cancel' parameter. Thus it will not change selection prior your MouseUp workaround.
Last edited by Krool; Jan 3rd, 2018 at 01:51 PM.
-
Jan 3rd, 2018, 08:39 PM
#1879
Addicted Member
Re: CommonControls (Replacement of the MS common controls)
Thanks for precious information VBnetmatrix . I will give these points a try and post my the result here
-
Jan 4th, 2018, 04:23 AM
#1880
Fanatic Member
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by Krool
It seems that behavior is wanted by the TabStrip control. It's done by comctl32.dll. (TCN_SELCHANGE)
Aha, I thought it was not intended.
The only workaround would be to handle MouseUp event and perform a HitTest.
Ok, that's not much effort.
Edit: you certainly also need to handle TabBeforeClick and pass True to the 'Cancel' parameter. Thus it will not change selection prior your MouseUp workaround.
And this makes trouble.
If I set Cancel to true, then I can't select a tab at all.
I could manage the Cancel value, but I think this is not a good approach.
See attached example.Tbs.zip
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|