-
Dec 27th, 2013, 05:28 AM
#161
Addicted Member
Re: CommonControls (Replacement of the MS common controls)
Hi Krool,
Merry Xmass!
I have replaced all labels and textboxes throughout a large project and everything runs fine both in the IDE and compiled. However, I am finding it almost impossible to modify any form. If I add, delete or even rename a control, then either the IDE crashes completely or I get the... Debug.Assert CBool(OldPointer <> NewPointer) Line.
I Presume that "Object has been modified while it is subclassed." is the problem but How do I prevent the sub classing to modify the form?
-
Dec 29th, 2013, 01:57 PM
#162
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by JohnTurnbull
I am finding it almost impossible to modify any form. If I add, delete or even rename a control, then either the IDE crashes completely or I get the... Debug.Assert CBool(OldPointer <> NewPointer) Line.
I can't replicate your problem. Is this problem also occuring in the demo project?
-
Dec 29th, 2013, 01:59 PM
#163
Junior Member
Re: CommonControls (Replacement of the MS common controls)
Regarding the Debug.Assert CBool(OldPointer <> NewPointer) bug,
I was reading a Readme file by a fellow regarding a rather large subclassing project, and he got around the IDE crash problem in a rather unique way, which might interest Krool.
Basically, he used a global Boolean to determine whether the application is being run within the IDE environment, or as an executed application.
The programmer changes the global to true if its in the IDE, and the subclassing code will (in theory) skip that nasty Debug.Assert CBool(OldPointer <> NewPointer) type stuff.
Anyway, happy holidays.
-
Dec 29th, 2013, 04:12 PM
#164
Addicted Member
Re: CommonControls (Replacement of the MS common controls)
No. Only in my project. In some forms, just changing the name of a control crashes the IDE.
-
Dec 29th, 2013, 04:30 PM
#165
Addicted Member
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by jay!
Regarding the Debug.Assert CBool(OldPointer <> NewPointer) bug,
I was reading a Readme file by a fellow regarding a rather large subclassing project, and he got around the IDE crash problem in a rather unique way, which might interest Krool.
Basically, he used a global Boolean to determine whether the application is being run within the IDE environment, or as an executed application.
The programmer changes the global to true if its in the IDE, and the subclassing code will (in theory) skip that nasty Debug.Assert CBool(OldPointer <> NewPointer) type stuff.
Anyway, happy holidays.
That sounds interesting - I already do that with hooking the mouse wheel which also crashes the IDE. I set a global constant so that it is only hooked when compiled. I wouldn't have a clue how to do it with Krool's stuff though....
Over to you Krool!
-
Dec 30th, 2013, 10:49 AM
#166
Addicted Member
Re: CommonControls (Replacement of the MS common controls)
Hi Krool,
First of all, let me say that your controls really are great. They are the only way I could ever convert my program to unicode. I hope when they're finished you are going to charge for them. I for one would me more than happy to pay.
In the mean time, they do have problems when you integrate them into a major project. As I said before, I now have forms in which I cannot change a control name without crashing VB6.
If you spend as much time on your controls as I do on my Spartan multi clipboard, then you won't have had time to try the controls out in a major project. Yes - they work perfectly in the demo. No - they don't work in something more complicated. If you would like see how bad these problems are, let me have an email address and I'll give you a download URL for my project.
I am currently ignoring the forms problem as I'm sure you'll fix it. In doing so, I've come across another problem. When I change the background color of a labelw, the caption and border disappear and are not immediately redrawn by the refresh....
Public Sub Refresh()
UserControl.Refresh
End Sub
They do eventually refresh but not until the processor is released. In this form.....
The cells are labelw's. The cell the mouse is over is colored blue. as you move the mouse the next cell is colored blue and the previous blue cell is set back to white. When the cells were VB6 labels, the recoloring was instant. with LabelW s , moving the mouse quickly results in missing captions and borders....
The missing captions and borders do redraw when the mouse stops moving. But it looks really bad while the mouse is in motion. Adding a control.refresh after each change makes no difference.
PS - If you don't have a good multi-clipboard, let me know and I'll send you one!
-
Jan 2nd, 2014, 04:11 PM
#167
Re: CommonControls (Replacement of the MS common controls)
Update released.
Originally Posted by byweb
TreeView won't raise "MouseUp" event if mouse is still. Why?
This update solves your problem.
-
Jan 5th, 2014, 08:09 AM
#168
Junior Member
Re: CommonControls (Replacement of the MS common controls)
Krool, I just wanted to give you a big thumbs up and thanks for your hard work.
I am from tweaking.com and every single program on the site I have done in VB6. My other programs on pcwintech.com I had to use 3rd party controls to get Unicode support. And I haven't added Unicode support for my apps on tweaking yet as I didn't want to have to replace every single control with a 3rd party one, and then go update all the code for the different controls.
Also I use manifest files to have any ocx and dll with the exe so I can do portable versions.
Thanks to your hard work, which I only found tonight as I am making a new program for the site, I will be able to do Unicode easier than ever and be able to use these controls for now on, reducing the size of the setups and portable versions thanks to not needing to have the MS ocx files. (Example, I just needed a listview in a program yet I had to have the large ocx (1.01 MB) file with it just for the one control)
From one programmer to another you have my respect. Keep up the good work.
Now time to try your controls out in the new program (And hopefully reply all the programs on the site with them). If you ever have a email list or something so I know when you make a new version you can sign me up!
Enjoy the new year :-)
-Shane
Last edited by SMC1979; Jan 5th, 2014 at 11:31 AM.
Reason: I suck at spelling :-)
-
Jan 7th, 2014, 04:10 PM
#169
Re: CommonControls (Replacement of the MS common controls)
I just added a "note" on the first post about error trapping as this could be a common "problem".
In order to trap error raises via "On Error Goto ..." or "On Error Resume Next" it is necessary to have "Break on Unhandled Errors" selected instead of "Break in Class Module" on Tools -> Options... -> General -> Error Trapping.
The actual problem is that the option "Break in Class Module" (which is the default one on a fresh VB6) just effects class modules and not usercontrols.
Example:
Code:
On Error Resume Next
RichTextBox1.LoadFile "xyz"
MsgBox Err.Number
When the option "Break in Class Module" is selected it is not possible to trap the error in above example which results always in a crash.
But when the option "Break on Unhandled Errors" is selected the error is trapped and you can evaluate the Err.Number.
Last edited by Krool; Jan 7th, 2014 at 06:13 PM.
-
Jan 13th, 2014, 04:57 PM
#170
Junior Member
Re: CommonControls (Replacement of the MS common controls)
Would it be possible to add the .span command to the richtextbox control? It is missing and I need it for a command I am using to color key words.
-
Jan 19th, 2014, 05:06 PM
#171
Re: CommonControls (Replacement of the MS common controls)
Update released.
Originally Posted by SMC1979
Would it be possible to add the .span command to the richtextbox control? It is missing and I need it for a command I am using to color key words.
The .Span method is not a build-in feature of the rich edit control.
I don't know how exactly this is working and how to re-build it.
If somebody knows how, please let me know.
Last edited by Krool; Jan 19th, 2014 at 05:12 PM.
-
Jan 22nd, 2014, 09:56 AM
#172
Re: PrintW
Originally Posted by JohnTurnbull
... However, when I try using it to the printer, although it executes without error, nothing gets printed at Printer.Enddoc. Any Ideas what I'm doing wrong?
Sorry for the delay! I haven't been able to test the PrintW subroutine with a printer until now. That sub, indeed, does nothing when printing to a printer. Although the DrawTextW API returns success and Err.LastDllError returns 0, nothing ever gets sent to the printer. I really don't know why. Sorry... You might want to try some other method of printing Unicode text instead.
On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0
Declare Sub CrashVB Lib "msvbvm60" (Optional DontPassMe As Any)
-
Jan 30th, 2014, 03:06 PM
#173
Re: CommonControls (Replacement of the MS common controls)
Update released.
Important bugfix when using the RichTextBox control as the UserControl_Terminate event did not fire..
-
Jan 31st, 2014, 04:12 PM
#174
New Member
Re: CommonControls (Replacement of the MS common controls)
Have just downloaded the stuff and liked it very much, but... When I click Custom property of ToolBar component Automation error occures and then all the things go wrong and eventually IDE crushes.
What could it possibly be? Is it on my side only?
-
Feb 1st, 2014, 11:01 AM
#175
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by Almeida
When I click Custom property of ToolBar component Automation error occures and then all the things go wrong and eventually IDE crushes.
What could it possibly be? Is it on my side only?
Did you included the property pages into the project? Which OS are you using?
-
Feb 1st, 2014, 02:38 PM
#176
New Member
Re: CommonControls (Replacement of the MS common controls)
I forgot to mention that I was experiencing this problem right in the Demo Project from the original archive. The line where the error occures is the last line of the code snippet below. The module of the Sub is PPToolBarGeneral.pag
Code:
Private Sub PropertyPage_SelectionChanged()
Dim i As Long
FreezeChanged = True
With PropertyPage.SelectedControls(0)
CheckEnabled.Value = IIf(.Enabled = True, vbChecked, vbUnchecked)
CheckVisualStyles.Value = IIf(.VisualStyles = True, vbChecked, vbUnchecked)
CheckDoubleBuffer.Value = IIf(.DoubleBuffer = True, vbChecked, vbUnchecked)
For i = 0 To ComboMousePointer.ListCount - 1
If ComboMousePointer.ItemData(i) = .MousePointer Then
ComboMousePointer.ListIndex = i
Exit For
End If
Next i
Dim ControlEnum As Object
If ImageListEnumerated(0) = False Then
For Each ControlEnum In .ControlsEnum
I have WinXP SP3. Do you think the problem may lie in one of the system files or VB6 itself? How can I make sure that all the necessary files (e.g. stdole2.tlb, etc) and VB6 with its IDE are up-to-date on my machine? Where can I see this sort of information?
Btw, same problem with CoolBar too. Yet, the page properties of some other components do open without troubles.
Last edited by Almeida; Feb 1st, 2014 at 02:44 PM.
-
Feb 1st, 2014, 02:52 PM
#177
Re: CommonControls (Replacement of the MS common controls)
Is the demo running? Means that you "only" have problems with certain property pages?
-
Feb 2nd, 2014, 01:22 AM
#178
New Member
Re: CommonControls (Replacement of the MS common controls)
Demo runs but without XP-styles and it does it only once. Re-running it causes fatal crush of IDE with a "memory can't be read" error. Am I in a big trouble with a glitchy Windows? This OS has been serving me for years but recently it has started acting up on different occasions. I've been procrastinating on installing a new one but it seems like the time has finally come.
Adding On Error Resume Next statement allowed me to run the property page, but with empty ComboImageList and all the images lost. Surprisingly, EXE from the original CommonControls.vbp was created successfully which let me take a good look at all the components in action.
If I do install a new system, please give me your advice on how to secure the latest (or known for its stabity rather) VB6. Will following this arcticle's steps do in your opinion?
http://inthiaano.com/2013/10/07/vb6-updates/
Or could you tell me about your enviroment? Is everything stable and smooth on your maching?
-
Feb 2nd, 2014, 07:27 AM
#179
Re: CommonControls (Replacement of the MS common controls)
It is normal that within the IDE there are no XP-Styles as you need a VB6.exe.manifest for getting this to work.
Is the EXE running without problems?
Have you tried re-installing vb6?
Maybe there is really a damage on your OS as you already assume.
-
Feb 2nd, 2014, 09:57 AM
#180
New Member
Re: CommonControls (Replacement of the MS common controls)
Yeah, it's a likely case. I really can't see what I can do apart from reinstalling OS or trying the projects in another "virgin" enviroment. But can't afford it at the moment. But after I do this I will report the outcome. Thank you for your support and the great work done! And yeah... EXE is working fine, I really loved the components
-
Feb 4th, 2014, 05:07 PM
#181
Re: CommonControls (Replacement of the MS common controls)
Update released.
Quite important bugfix when using the RichTextBox control.
-
Feb 4th, 2014, 08:35 PM
#182
New Member
Re: CommonControls (Replacement of the MS common controls)
Hello Kroll,
How to compile the source code to (for example) comctl.ocx?
Can you give us the guide?
Thank you very much.
-
Feb 6th, 2014, 04:40 AM
#183
New Member
Re: CommonControls (Replacement of the MS common controls)
i just want to thank you "Krool" your unicode controls really helped me
i wish you luck
-
Feb 9th, 2014, 06:24 AM
#184
Hyperactive Member
Re: CommonControls (Replacement of the MS common controls)
Hi Krool,
Thank you very much for your work on the Common Control Replacement.
I am trying out the DataTimePicker and may have stumbled on a bug. This is what I did.
In your VBP demo, I added a DTPicker2 and add the following code:
Private Sub DTPicker2_Change()
MsgBox "change"
End Sub
I ran the project and clicked on DTPicker2 to pop up the Calendar.
When I clicked on any date in the calendar, the MsgBox fired and I closed it.
The MsgBox immediately fired one more time and I closed it again.
It should fire only one time.
When I clicked on the "<" button on the calendar to go to the previous month,
the MsgBox fired and I closed it. Then immediately, it fired repeatedly and
I have to go to Task Manager to kill the VB6 process.
The same happened when I clicked on the ">" button to go the next month.
-
Feb 10th, 2014, 07:16 AM
#185
New Member
CommonControls (Replacement of the MS common controls)
hello Krool
why when i use unicode controls in my project, the IDE crashes after first run? giving this error "CBool(OldPointer <> NewPointer)"
but in demo sample it doesn't get that error, i cant really find what is the problem..
-
Feb 10th, 2014, 04:33 PM
#186
Re: CommonControls (Replacement of the MS common controls)
Update released.
Included the modeless dialogs "Find" and "Replace" in the CommonDialog class.
Unlike the "Find and Replace Common Dialogs" from vbAccelerator these have no issues with the tab keys.
Also mine support multiple modeless dialogs at the same time. But only one per CommonDialog class.
Means that each "single" class can only run one modeless "Find" or "Replace" dialog at the same time.
Sample usage is demonstrated in the RichTextBox Demo.
Originally Posted by dr_efendi
How to compile the source code to (for example) comctl.ocx?
You mean of how to create a ActiveX Control project?
Originally Posted by chosk
I am trying out the DataTimePicker and may have stumbled on a bug. This is what I did.
In your VBP demo, I added a DTPicker2 and add the following code:
Private Sub DTPicker2_Change()
MsgBox "change"
End Sub
I ran the project and clicked on DTPicker2 to pop up the Calendar.
When I clicked on any date in the calendar, the MsgBox fired and I closed it.
The MsgBox immediately fired one more time and I closed it again.
It should fire only one time.
When I clicked on the "<" button on the calendar to go to the previous month,
the MsgBox fired and I closed it. Then immediately, it fired repeatedly and
I have to go to Task Manager to kill the VB6 process.
The same happened when I clicked on the ">" button to go the next month.
I have researched this and it seems to be by "design" that the change event (DTN_DATETIMECHANGE) does fire sometimes twice.
And also can cause a loop when for instance showing a MsgBox in the change event as the DTPicker did not receive until then a MouseUp event.
I did a little workaround to fix this and it should be the same behavior now as the original control.
Originally Posted by quicken
why when i use unicode controls in my project, the IDE crashes after first run? giving this error "CBool(OldPointer <> NewPointer)"
but in demo sample it doesn't get that error, i cant really find what is the problem..
It is impossible to help you without knowing the details of your project.
-
Feb 10th, 2014, 06:25 PM
#187
New Member
CommonControls (Replacement of the MS common controls)
thank you for your replay krool
i don't know what was the problem, but i replaced controls with updated controls (one of the modules) and my problem solved... thanks again
-
Feb 11th, 2014, 01:24 AM
#188
Hyperactive Member
Re: CommonControls (Replacement of the MS common controls)
Hi Krool,
Thank you very much. I appreciate it.
-
Feb 11th, 2014, 03:53 AM
#189
New Member
CommonControls (Replacement of the MS common controls)
hello krool
I searched the internet and i fund this code :
http://www.Planet-Source-Code.com/vb...59434&lngWId=1
i don't know have you seen this code or not but it would be grate if you do something like this in your unicode controls...
-
Feb 11th, 2014, 05:35 AM
#190
Hyperactive Member
Re: CommonControls (Replacement of the MS common controls)
Hi Krool,
I have just replaced 16 ccrpDTP with your DTPicker.ctl and removed ccrpDTP6.ocx and ccrpUCW6.dll. I have also replaced 4 UpDown with your UpDown.ctl and removed ComCT232.ocx. I am moving on to a lot more from ComCtl32.ocx.
One question I like to ask is that to mimick the DTPs from MSComct2 and ccrpDTP that prevent the mouse wheel from changing the date, I have REM out the following in DTPicker.ctl:
Case WM_MOUSEWHEEL from Function WindowProcControl
and
Case WM_MOUSEWHEEL from Function WindowProcCalendar
Is there any side effect that I should be aware of by doing this?
-
Feb 11th, 2014, 05:58 AM
#191
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by quicken
Thanks. I took a look on this and it seems it works via DLL. (ActiveX DLL Project)
And the point is that I don't want this project to have a dependency on any .ocx or .dll.
Originally Posted by chosk
One question I like to ask is that to mimick the DTPs from MSComct2 and ccrpDTP that prevent the mouse wheel from changing the date, I have REM out the following in DTPicker.ctl:
Case WM_MOUSEWHEEL from Function WindowProcControl
and
Case WM_MOUSEWHEEL from Function WindowProcCalendar
Is there any side effect that I should be aware of by doing this?
You can delete the WM_MOUSEWHEEL handler if you want. No side effect.
-
Feb 11th, 2014, 06:26 AM
#192
Hyperactive Member
Re: CommonControls (Replacement of the MS common controls)
Hi Krool,
I am moving on to ImageList and encounter "User-defined type not defined" on the following line in ImageList.ctl:
Private PropListImages As ImlListImages
-
Feb 11th, 2014, 06:58 AM
#193
Hyperactive Member
Re: CommonControls (Replacement of the MS common controls)
Hi Krool,
Please ignore my previous post. I forgot to add the ".cls" files. Sorry.
-
Feb 12th, 2014, 01:08 AM
#194
Hyperactive Member
Re: CommonControls (Replacement of the MS common controls)
I Krool,
May I ask whether you have plan for a replacement of the MSINET.OCX?
-
Feb 12th, 2014, 08:28 AM
#195
Hyperactive Member
Re: CommonControls (Replacement of the MS common controls)
Hi Krool,
I am into the last 4 Listviews to replace, having already done many simple ones. For these last 4, I have already got the proper numeric sorting to work. Cell text forecolor should be easy to implement. But I can seem to get alternate ledger color to work. The one I was using utilizes subclassing but it is not working now. Since your controls use a lot of subcalssing, I thought maybe I find some other method. So I search an old source I am familiar with and found it:
http://vbnet.mvps.org/index.html?cod...l/lvledger.htm
I have changed the following in the code:
If lv.View = LvwViewReport Then (from If lv.View = lvwReport Then)
Dim itmX As lvwListItem (from Dim itmX As ListItem)
I REM out he following:
lv.Visible - because this doesn't work after ListView is passed to a Sub (lv as ListView...)
I ran the project, the text in the ListView show up as expected but the alternate ledger color does not work.
I tested with the ListView from MSCOMCTL.OCX and it works.
May I ask is there some thing I need to look at?
-
Feb 12th, 2014, 05:07 PM
#196
Re: CommonControls (Replacement of the MS common controls)
Update released.
Originally Posted by chosk
I REM out he following:
lv.Visible - because this doesn't work after ListView is passed to a Sub (lv as ListView...)
This works now.
Originally Posted by chosk
I ran the project, the text in the ListView show up as expected but the alternate ledger color does not work.
I tested with the ListView from MSCOMCTL.OCX and it works.
May I ask is there some thing I need to look at?
There was a problem that the '.Image' property of the PictureBox was directly passed to the Picture property of the ListView. But this case is now solved in the update.
Keep in mind that the Picture property requires comctl32.dll version 6.0 or higher in order to work.
But you could just use for this case the 'ItemBkColor' event. (?)
This sample will make a red background color of every second ListItem.
Code:
Private Sub ListView1_ItemBkColor(ByVal Item As LvwListItem, ColorRef As Long)
If Item.Index Mod 2 Then ColorRef = vbRed
End Sub
-
Feb 13th, 2014, 04:35 AM
#197
Hyperactive Member
Re: CommonControls (Replacement of the MS common controls)
Hi Krool,
Thanks for the update.
.Visible now works after ListView is passed into a Sub.
Silly me. Didn't realise ItemBkColor exists in your ListView ctl. Been too used to MS's that I did not think of this. This makes it so much easier. Now I can even implement Alternate Ledger Color on ListViews where I could not. This is fantastic.
Now I am left to find ways to do stuff I did with msinet.ocx and I should be free of com registration problem that Win8 is causing a lot of pain.
-
Feb 17th, 2014, 02:27 AM
#198
Hyperactive Member
Re: CommonControls (Replacement of the MS common controls)
I just like to update that I have replaced the use of msinet.ocx with MSXML. It is pre-installed in WinXP SP3 and later (up to Win8.1) and can be installed in WinXP SP2 with Windows Installer. The important thing for me is it has the option to use Username and Password which is what I need.
http://msdn.microsoft.com/en-us/data/bb291077.aspx
The only controls I have not replaced are those "basic" ones that come pre-installed in VB6 - label, command button, frame, check, option, combo, text. Am I right to understand that these do not require "addition" dependencies outside of the VB6 runtime and the few that are Windows system files?
-
Feb 17th, 2014, 06:05 AM
#199
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by chosk
The only controls I have not replaced are those "basic" ones that come pre-installed in VB6 - label, command button, frame, check, option, combo, text. Am I right to understand that these do not require "addition" dependencies outside of the VB6 runtime and the few that are Windows system files?
Yes, you are right. No "addition" dependencies. There are included in the msvbvm60.dll.
-
Feb 17th, 2014, 09:23 AM
#200
Hyperactive Member
Re: CommonControls (Replacement of the MS common controls)
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
|