Can you post the exact line and the entire procedure where that error occurs? Can you also please provide additional details about your issue?
Printable View
Thank you for replying.
The error is precisely on the With instruction.
As workaround I have directly assigned values without the width prefix and works without problems:
..but it don't work if I use the With instruction:Code:Let MainForm.TabStrip.Tabs(TabsCounter).Caption = strTab(TabsCounter)
..and the .key variable is read-only. Is not very important, but in the original ocx is r/w.Code:With MainForm.TabStrip.Tabs(TabsCounter)
Let .Caption = strTab(TabsCounter)
End With
Thanks again.
Gigirex
hello
I just found by chance a bug in "CommonDialog.ShowOpen"
It is not possible to use "FileName" as the default file.
The simple solution is to add
Code:Public Function ShowOpen() As Boolean
Dim Buffer As String, Filter As String
Buffer = String(PropMaxFileSize, vbNullChar)
Mid$(Buffer, 1) = PropFileName' Code add.
Dim OFN As OPENFILENAME
With OFN
Refer to #659
Code:NewPrinterName = Mid$(DNAMES.wExtra, _
DNAMES.wDeviceOffset - DNAMES.wDriverOffset + 1)
NewPrinterName = VBA.Left$(NewPrinterName, _
InStr(NewPrinterName, Chr$(0)) - 1)
hello
Just for information:
Why do this:
while the following code does the same thing?Code:Buffer = String(PropMaxFileSize, vbNullChar)
If Not PropFileName = vbNullString Then
If Len(PropFileName) > (PropMaxFileSize + 1) Then
Length = PropMaxFileSize * 2
Else
Length = LenB(PropFileName)
End If
CopyMemory ByVal StrPtr(Buffer), ByVal StrPtr(PropFileName), Length
End If
VB guaranteed that the replacement string will never exceed the original chain.Code:Buffer = String(PropMaxFileSize, vbNullChar)
Mid$(Buffer, 1) = PropFileName
(that is what is written in Help)
For proof:
Finally, in VBCCR11.ocx, "CommonDialog" does not have the event "InitDialog".Code:a$="123456789"
?lenb(a$)
18
mid$(a$,1)="09876543210"
?a$
098765432
?lenb(a$)
18
c$=vbnullstring
mid$(a$,1)=c$
?a$
098765432
?lenb(a$)
18
It is normal?
cordially
I have noticed that the ImageList is causing a lot of problems(Crashing, and by that sometimes corrupting the frm/frx file), has anyone had the same experience.
will projects using VBCCR11.OCX automatically update to VBCCR12.OCX?Quote:
Yes. The event "InitDialog" will be on VBCCR12.OCX. (not yet released)
Update released.
Update released.
Found out that in the VisualStyles.bas and in CommandButtonW.ctl (graphical style only) in case the button is disabled the 'DisabledPicture' was drawn in disabled state, instead it should be drawn normally or masked. Only when there is no 'DisabledPicture' the drawing should be in disabled state in case the button is disabled.
This issue is now fixed. Thus the behavior now matches to the intrinsic VB control.
Ever figure out anything about why all the IPPB stuff is always throwing errors ?
VTableHandle.IPPB_GetDisplayString.Error2->Type mismatch
VTableHandle.IPPB_GetPredefinedStrings.Error2->Type mismatch
"Set ShadowIPerPropertyBrowsingVB = This" is the number one source of the errors. Click on control after clicking something else first, bunch of those errors scroll by, 9/10 properties disappear. Have to close and reopen form to get them back.
Hi, can you provide the events for this great control. I am using this for it's Treeview control as a work-around to the Win7/8 64 system issues with the old Treeview control, what a MS mess...
However, I cannot seem to get the Click event to work as with the VB 5/6 MS Treeview control. And, when I End the EXE Program or when in VB design mode, I get a Windows (7/8) error that checks for a problem sol'n, but can't find. Must then terminate the program.
Thank you so much, I see this as the ultimate sol'n to what MS does.
Again, thanks... Paul
Does the Click event fire or not? Or does it not work the same only?Quote:
What about the other events. Please more details. Thanks
Do you call the InitVisualStyles method at startup in the EXE?Quote:
Is this also happening in the Demo project?
What are the events for TreeView (such a Node Click)? When Ending the program, all crashes, any fix. Thanks, Paul
The issue is I can't find the code for the node click event. I only get 4 options, such as gotfocus, etc...
Have no idea on the IniVisualStyle code is or location to place in the EXE.
We have a major program for chemical engineers that does not work with the latest MS release of Comctl... We and our Clients are panicking
Do you know anyone that can work with us? We are ChemE's and this is beyond us...
Thanks, Paul
This article seems to provide the reasons for the crash when closing the program...
http://www.vbaccelerator.com/home/VB...wn/article.asp
But I don't like the sol'n... Paul
The Type Mismatch errors don't seem to be happening in the demo project. I should also clarify it's only an issue in the IDE. It's never given that error or crashed while running, either from VB or compiled.
If I had to guess, the 'type mismatch' is related to the fact that OLEGuids.IPerPropertyBrowsingVB and OLEGuids.IPerPropertyBrowsing are both being used- and if it's me only... I'll look for something not explicitly typed to OLEGuids but I also have olelib.IPerPropertyBrowsing that has a different set of methods. However it's not in use anywhere and everything in your project is explicitly typed as OLEGuids.IPer.. so not sure how such a conflict would arise. Why these three all have a different set of methods is bothersome...
Code:Private Sub ReplaceIPPB(ByVal This As OLEGuids.IPerPropertyBrowsing)
If VTableSubclassPPB Is Nothing Then Set VTableSubclassPPB = New VTableSubclass
If VTableSubclassPPB.RefCount = 0 Then
VTableSubclassPPB.Subclass ObjPtr(This), VTableIndexPPBGetDisplayString, VTAbleIndexPPBGetPredefinedValue, _
AddressOf IPPB_GetDisplayString, 0, _
Private Function IPPB_GetDisplayString(ByVal This As Object, ByVal DispID As Long, ByVal lpDisplayName As Long) As Long
Dim ShadowIPerPropertyBrowsingVB As OLEGuids.IPerPropertyBrowsingVB
[..]
Set ShadowIPerPropertyBrowsingVB = This 'type mistmatch
The solution is already implemented into the controls. ("LoadLibrary("shell32.dll")", etc.)Quote:
The InitVisualStyle method is located in VisualStyles.bas.
I had this problem also once and the reason was by one specific control. Maybe you can trial and error and look if it still crashes when you remove the controls except one and so on... So you run-trough all controls and trace the source of the problem.
Thanks, the only time it happens for my existing project (10+ years old) was 2 days ago when we included the VBCCR11.OCX. And we only use the TreeView from this OCX, on 1 form, of over 5 dozen forms. The crash occurs at an End statement. The situation is that we must use the VBCCR11.OCX TreeView to provide access to the 100's of program we have in the QMC Program Suite. See QMC.net. Thanks so much, Paul
FYI: The new MS supplied ComCtl32/TreeView does not work any more with the functionality we and many others need (and as seen on many forums) and is not compatible with any past releases (since 1997). Right now it is only the TreeView they have changed making this a complete MS Mess. With the way they do it provides no work around. You cannot put the required ComCtl32 in the System32 or W[/B][/B]OW folders and over write the new MS ComCtl32 since it affects IE and other programs. And when the old ComCtl32 is placed in rhe APP.PATH it will not register (programs still use the new new ComCtl32). Please help...
It is not recommended at all to use the End statement. Does it crash when you make a 'clean' close of your App?
Don't know what a "clean-close" is...? P
Close the App by closing all Forms for instance instead of an End statement.Quote:
Did and it works great now... What about the Node Click Event, does it exist for the TreeView with your Controls? Thanks, so much. (How can I repay you for this? You are invaluable for sure!!!)
Yes, of course.Quote:
Can you give me a sample code for the sub? I cannot find any click event under the object browser folder library for your control... Thanks, Paul
Do you know a VB consultant that can help us move to your controls? We have to get rid of MS dependencies or die... Paul
Can you see the NodeClick event in the Demo project?Quote:
Attachment 127215
What demo, all I have found are 2 versions of the OCX? I am using VBCCR11.OCX which is a zip. The only demo I have found is for a MDI ToolBar... Can you please tell me wher the TreView DEMO is? Thanks, Paul
But anyway, I get 4 events in my program with your Control: DragDrop, DragOver, GotFocus, and LostFocus. That's It, No Mas. Nothing of what you show... ??? Re, Paul
On the first page the first post is a attachment "ComCtlsDemo.rar.zip". (On the bottom of the post)
Thanks, checking it out. Paul
Hey Krool, does your TreeView have events for the adding and removal of nodes ?
Krool knows for sure, but using the followong seems to work:
Set nodX = tvQMCProgram.Nodes.Add(, , "Data Mining", "Data Mining Programs", 1, 2)
'Sub Folder Data Screener
Set nodX = tvQMCProgram.Nodes.Add("Data Mining", tvwChild, "DS", "Data Screening", 1, 2)
'QMCDLLs
MyName = "DataScreener DLL Test"
Set nodX = tvQMCProgram.Nodes.Add("DS", tvwChild, MyName, MyName, 3)
However, I cant seem to get the icons to load from a ImageList...
Paul
PS: I also have the VB5 Comctl32.OCX loaded with Krool's in the same project... P
I am thinking the:
Function HitTest(X As Single, Y As Single) As TvwNode
And the Selected Item (Node) should work within the above FNC. I will try over the weekend... Paul
Oh, if you did, I just wanted to know what messages you intercepted. I have an inherited TreeView in .Net where I added events for the addition and deletion of nodes but its not perfect. There was no real direct message for these events so I had to get a bit clever but the solution has a couple nuances.
The VBCCR11.ListView control, while doing a drag operation throws "Run-time error '0'" intermittently and causes the application to crash.
Attachment 127301
Any insight on potential causes for this issue would help.
No, the original control (MSComctlLib.ListView) that was replaced did not have this issue.
I've attached the event handlers and properties. I did observe that when the run-time error happens, it does not hit the trace message at the beginning of OLEStartDrag event handler. It seems like something is happening even before that. When I debug, the application crashes after this error and I get a memory reference exception.
Attachment 127335
In my tests the OLEStartDrag event fires w/o any run-time error.. (W2K, WinXP and Win7 tested)
By StdEXE-ListView I did not mean the MSComctlLib.ListView, rather I mean my ListView control. (non-OCX, can be found in the Demo project) Can you test if there is the same issue?
Do you also use the latest VBCCR11.OCX version? (revision number)
I've not been able to reproduce the issue in the Demo project. However, as you can see, the implementations are different in both cases. It's not clear what is causing the issue.
I was able to reproduce the run-time error on the latest version of VBCCR11.OCX (Revision 32).
Additionally, I was able to identify that the following line (in red) in VBCCR11 is what is causing the run-time error (Overflow):
Private Sub UserControl_OLEStartDrag(Data As DataObject, AllowedEffects As Long)
If ListViewDragIndex > 0 Then
If ListViewHandle <> 0 Then
Dim P(0 To 1) As POINTAPI, RC As RECT
GetCursorPos P(0)
ScreenToClient ListViewHandle, P(0)
SendMessage ListViewHandle, LVM_GETITEMPOSITION, ListViewDragIndex - 1, ByVal VarPtr(P(1))
SendMessage ListViewHandle, LVM_GETVIEWRECT, 0, ByVal VarPtr(RC)
ListViewDragOffsetY = (P(1).Y - P(0).Y) + RC.Top
ListViewDragOffsetX = (P(1).X - P(0).X) + RC.Left
End If
If PropOLEDragMode = vbOLEDragAutomatic Then
Dim Text As String
Text = Me.FListItemText(ListViewDragIndex, 0)
Data.SetData StrToVar(Text & vbNullChar), CF_UNICODETEXT
Data.SetData StrToVar(Text), vbCFText
AllowedEffects = vbDropEffectMove Or vbDropEffectCopy
End If
End If
RaiseEvent OLEStartDrag(Data, AllowedEffects)
If AllowedEffects = vbDropEffectNone Then ListViewDragIndex = 0
End Sub
Another difference when compared to the demo is that in our case we are doing a drag and drop on controls that are in different forms. (The demo project has both the controls in the same form.)
We are using your library extensively for Unicode support and it has been very beneficial so far.
Update: We were able to identify the root cause of the run-time error. It was caused by one of the long variables (RC.Top/ RC.Left) getting set to it's max value (2147483647) and the addition operation caused an Overflow exception.
Is the same happening when you use the Std-Exe ListView?
If yes, what are the debug values? Maybe the var type 'Long' for ListViewDragOffsetX/Y is not sufficient..
EDIT: Ok you figured out that the RC.Top / RC.Left values (in fact LVM_GETVIEWRECT) are set to its max value and of course causing an Overflow exception. Try to declare ListViewDragOffsetX/Y as Double instead of Long. Does this solves the issue?
Yes, technically, using Double would solve the problem. In our case, we just added a check to see if RC.Top is > max value, if yes, then set ListViewDragOffsetY to max value instead of doing an addition operation. This solved the problem for us. We'll wait for you to provide a fix for your library and in the interim, we'll use this solution, thanks.
The textbox has a great Propertywould it be possible to add AllowDecimal, and/or how many digits after the Decimal?Property Code:
AllowOnlyNumbers
Thanks so much for this excellent control. Just wondering if you could add a vertical alignment property to the label and textbox control.
[...]
The source code for the ActiveX Controls are not public.
But the code for the Std-EXE Controls (located in the ComCtlsDemo project) are public. These are also with the latest features as the ActiveX Control project will be updated rarely. (Until now only two versions; 1.0 and 1.1)
Only bugfixes will be updated to the existing ActiveX Control versions, as this does not break binary compatibility.
[...]
This is a bit off-topic question, but is there a replacement for Frame control because of this problem: Attachment 127711
I'm so blind... Thanks for the controls, you did an excellent job!