-
Re: CommonControls (Replacement of the MS common controls)
Quote:
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..
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
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
-
Re: CommonControls (Replacement of the MS common controls)
OCX Version 1.5 now released.
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
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.
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
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.
-
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?
-
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.
Quote:
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.
-
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.
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
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
-
1 Attachment(s)
Re: CommonControls (Replacement of the MS common controls)
New Pager Problem
Try with the attached.
Attachment 153961
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.
-
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.
-
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.
-
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!
-
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
-
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?
-
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)
-
Re: CommonControls (Replacement of the MS common controls)
-
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?
-
Re: CommonControls (Replacement of the MS common controls)
thanks karl , here is the test for the ocx
https://youtu.be/sPcpaampZa4
-
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
-
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.
-
1 Attachment(s)
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
Attachment 154437
-
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.
-
1 Attachment(s)
Re: CommonControls (Replacement of the MS common controls)
yes karl vb6 runs with admin rights .
Attachment 154439
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
-
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
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
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
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
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.
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
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?
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
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.
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
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?
-
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.
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
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.
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
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.
-
Re: CommonControls (Replacement of the MS common controls)
Any suggestions for my question guys ?
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
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
-
Re: CommonControls (Replacement of the MS common controls)
double post for some server reason...
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
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.
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
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.
-
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
-
1 Attachment(s)
Re: CommonControls (Replacement of the MS common controls)
Quote:
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.
Quote:
The only workaround would be to handle MouseUp event and perform a HitTest.
Ok, that's not much effort.
Quote:
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.Attachment 155021