Coder Social home page Coder Social logo

vbccr's Introduction

vbccr's People

Contributors

kr00l avatar nbechtloff avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vbccr's Issues

Cannot compile projects.

When compiling projects. A Compile error "ByRef Argument Type Mismatch" occurs in a function 'Original_IPPB_GetDisplayString' in 'VtableHandle.bas'.

The function is declared as
Private Function Original_IPPB_GetDisplayString(ByRef This As Long, ByVal DispID As Long, ByRef pDisplayName As Long) As Long

So, 'pDisplayName' is ByRef Long, but it is used to call ShadowIPPB.GetDisplayString which seems to need String.

sorry for my poor english.

Double Click "Jump to source"

If a CommandButtonW is placed on another UserControl and that Control is compiled into an ocx the Double Click "Jump to source" feature does not work on the host control in the IDE. This seems to only be a problem if the CommandButtonW style is set to graphical.
I found this in WindowProcControl line 2012:
Case WM_LBUTTONDBLCLK
If (GetWindowLong(hWnd, GWL_STYLE) And BS_OWNERDRAW) = BS_OWNERDRAW Then
' Buttons having the BS_OWNERDRAW style will not respond to double click as normal buttons do.
' Thus the default window procedure of the button will be called with WM_LBUTTONDOWN instead of the actual WM_LBUTTONDBLCLK.
WindowProcControl = ComCtlsDefaultProc(hWnd, WM_LBUTTONDOWN, wParam, lParam)
Exit Function
End If

So if the button is graphical its window style gets the BS_OWNERDRAW set and it swallow the double click events the IDE needs?

Regards,

ListView.hideSelection = False is not working

To reproduce:

  1. Create a blank project with a TextBox and a ListView

  2. Copy and paste this code:

Private Sub Form_Load()
Call ListView1.ListItems.Add(1, "key", "text")
ListView1.HideSelection = False
End Sub

  1. Move the selection from the TextBox to the ListView and back to the TextBox
  • Bug: Expected the ListView item to still be selected. ListView1.HideSelection = False does not appear to do anything

CommonDialog wrong constant

I think the constant FR_HIDEMATCHCASE should be &H8000&
But its declared in CommonDialog.cls line 409:
Private Const FR_HIDEMATCHCASE As Long = &H8000

Databinding not working in IDE on TextBoxW

There is a problem that a Textbox bound to a Datasource does not update the Datasource properly if the Textbox loses focus by clicking on another control - leaving the Textbox with Tab Key works. This only happens in the IDE, in the compiled .exe it works.
I am using the VBCCR16.ocx but I assume its also a problem in VBCCR17. Maybe other controls are affected by this too.

The problem is easy to reproduce:
Create a new exe project.
Place two textboxes on the form.
Add a reference to ADODB.
Place the following code in Form_Load:
Dim Data As ADODB.Recordset
Set Data = New ADODB.Recordset
Data.Fields.Append "aString", adVarChar, 25
Data.Open , , adOpenStatic, adLockBatchOptimistic
Data.AddNew Array("aString"), Array("123")
Data.UpdateBatch

TextBoxW1.DataField = "aString"
TextBoxW2.DataField = "aString"
Set TextBoxW1.DataSource = Data
Set TextBoxW2.DataSource = Data

If you run the program in the IDE and change the text in one textbox and tab away the other textbox's text changes.
If you instead click on the other textbox its text is not updating (the underlying datasource is not updated).

Circular reference when using imagelists?

Hi,
control which use an imagelist (e.g. TabStrip, Listview) do not unload properly when imagelist is set from the property page designer.
I use several custom controls and the UserControl_Terminate() event is never raised. This becomes a real problem if these custom controls are not placed on your main form, because they leak GDI handles.
My workaround at the moment is setting the imagelist per property at runtime e.g. in UserControl_Initialize:
myListView.Icons = myImagelist.object.
Then everything works fine.
I tried to locate the problem in the source but no chance.
By the way great controls! Keep up the good work.

Forgot to mention: I use the ocx library.

Runtime Error 713 - Class not registered

Hey,

I'm looking to use this in an existing project, with the OCX version. I've registered it and have linked it to the project, along with OLEGuids.tlb.

I've updated some of the standard controls to point to the VBCCR16 ones. When I double click on some of the forms in VB6, the RTE 713 comes up, with VBCCR in the warning message title. Likewise when I try to run the application.

I can't reproduce it with a brand new project though.
So I'm not expecting a resolution, just maybe someone has come across it before or might have any thoughts on what it could be or where to look into it?

No issue, but a question about IME handling

Hi,

I've found out that the following code makes the Windows 10 emoji IME work correctly with these controls in VB6 apps:

Case WM_IME_CHAR
        SendMessage hWnd, WM_CHAR, wParam, ByVal lParam
        Exit Function

But in the code I can see a lot more special handling, e.g. the ComCtlsPeekCharCode stuff. Can you tell me when this extra code is necessary? I have deactivated it and so far cannot see any difference.

Awesome work by the way. ๐Ÿ‘

Best regards

auto scroll on richtext

Hello
You made great help to all of us.
i started to use ocx and control version noticed bug on richtext change event.
Normally i used original richtext ocx do this.
when textarea is bigger its auto scroll to last line.
with change event on richtext
richtext.SelStart = richtext.hWnd
also try this
richtext.SelStart = richtext.hWndUserControl

both seems not working. i try to debug on controls but seems taking much time so i am reporting to you may be you can find faster then me?

regards,

IPerPropertyBrowsing implementation has incorrect use of CoTaskMemAlloc (take 2)

Apologies for the previous incorrect bug report. Here's the correct one:

In IPPB_GetPredefinedStrings, you'll see this:

    pCaStringsOut.cElems = cElems
    pCaStringsOut.pElems = pElems
    For nElemCount = 0 To cElems - 1
        lpString = CoTaskMemAlloc(Len(StringsOutArray(nElemCount)) + 1)
        CopyMemory ByVal lpString, StrPtr(StringsOutArray(nElemCount)), 4
        CopyMemory ByVal UnsignedAdd(pElems, nElemCount * 4), ByVal lpString, 4
    Next nElemCount

First, note that you haven't copied the content of the string into lpString, you've just moved the StrPtr around.

Ultimately what's actually happening here is that the pElems array just gets filled with the direct pointers from StrPtr(StringsOutArray(nElemCount)), so you've essentially populated the LPOLESTR array with BSTRs instead. This is a problem, because the caller is responsible for freeing the strings, and so it calls CoTaskMemFree on the BSTR, which is invalid and causes an immediate exception that I can see under a native debugger.

ListViewItem.ListItems(key) should not give error for missing key

Set getItem = ListView.ListItems(key) ' throws an error but:

If ListView.ListItems.count = 0 and Not ListView.ListItems.exists(key) Then
Set getItem = ListView.ListItems(key) ' throws an error
end if

' Expected ListView.ListItems(key) to return Nothing rather than throw an error.

No Wiki!

Please create the VBCCR wiki for all of us to help you create and add documentation.

MouseEnter event never get triggered

Hi,
it seems MouseEnter is never triggered, at least with TextBoxW and ListBoxW controls.
Can you please, look?

Appreciate, and good day to you!

Scrollbar controls

Could scrollbar controls be added to this project please? I think all other standard controls are there, but not the scrollbars,

ListView.SetFocus() raises an error when ListView.Visible = False

To reproduce,

  1. Put a ListView control on a form
  2. Execute this code:
ListView.Visible = false
ListView.SetFocus()

The bug is in ListView.cls and is pretty simple to fix:

Public Sub SetFocus()
+ If Me.Visible then ' Add this if check
    Extender.SetFocus
+ End If
End Sub

Cannot set LvwListItem Key

I tried the VBCCR16 ListView as a nearly drop-in replacement for the ComctlLib ListView but discovered that whereas the ComctlLib ListItem Key is read/write, the LvwListItem Key is read-only. Is there a reason it is not read/write?

Referencing VBCCR13 or VBCCR15 from VB.net error

Hi Krool, I'd like to thank you and express my respect to the project you have built and maintain.
Your controls are great and stable so I implemented some of them my software product in Serbia. If there is something you need help with, I'd be glad to do that (if capable :)

As for the issue, it's about referencing the VBCCR library (or any of user-controls built using VBCCR components) from VB.net (tried versions 2013-2017).

VB.net interops with ActiveX controls making a wrapper automatically. It works for MSHFlex, my own VB6 built user controls, and some other controls I've tried. But when referencing VBCCR13.ocx (or VBCCR15.ocx) following warning errors occur preventing Vb.net to build the wrapper:

1.Error loading type library/dll (TYPE_E_CONTLOADLIBRARY) - 0x80029C4A
2.Could not determine the dependencies of the COM reference "VBCCR15". Error loading type library/DLL. (Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY))			
3.Could not determine the dependencies of the COM reference "VBRUN". Type mismatch. (Exception from HRESULT: 0x8002802A (TYPE_E_WRONGTYPEKIND))
4.The referenced component 'VBCCR15' could not be found.

Now, I must mention that the component is registered correctly and fully functional from within VB6.

Note

  1. The same happens when loading with OleView's "TypeLib Viewer"
  2. The VBCCR10 can be viewd with "TypeLib Viewer", still can't be referenced from .Net, but with only one error - the Could not determine the dependencies of the COM reference "VBRUN" (No.3).

The question is, do you have any idea, or some advice what should I do, or where to start looking in the source code to help resolve this issue, and make VBCCR referable from within VB.net ?

Thanks andd best regards,

Milan

TextBoxW doesn't get de referenced when hosted in another usercontrol

TextBoxW contained in another custom UserControl doesn't de reference when UC gets terminated. In these cases when the form gets unloaded, TextBoxW doesn't terminate with it. Instead it lives until the end of application producing crashes (protected memory read) on the exit.

It happens when the TextBoxW control looses focus by clicking on certain type of controls (MSHFlexGrid, MSFlexGrid,...) on the same form. It doesn't happen if the focus is lost by tabbing or using other keyboard methods.

To investigate the code I've made a project group containing VBCCR16.vbp and a small exe (Crash.vbp) containing a simple UserControl having a PictureBox with TextBoxW on it.

The main form Crash.frm contains MSHFlexGrid, CommandButton and a UserControl on it.
I made some changes so that TextBoxW shows its Reference Counter on request.

These are the steps to reproduce the problem:

  1. When TextBoxW (on the UserControl) gets the focus there are 8 references to it.
  2. When the focus is lost by clicking on the forms CommandButton number of references drops to 5.
  3. When the focus is lost by clicking on the forms MSHFlexGrid number of references drops to 6.
  4. When the focus is lost by presing TAB landing on either the CommandButton or MSHFlexGrid number of references drops to 5.

When number of references is 6, the TextBoxW doesn't terminate on form unload, but strangely, both the UserControl containing it and the Form does. That makes me think that it somehow holds the reference to itself.

This doesn't happen when TextBoxW is hosted directly on the form or PictureBox placed on the form. In that case, clicking or tabbing to MSHFlexGrid drops references to 5.

Examining the messages shows equal patterns in all cases of focus switching.

Do you have any clue of what could be the reason ?

I can give you a project group I've made if this is of any interest to you.

BTW, the code you made is AMAZING !!!
There are many difficult concepts and hacks I wasn't aware VB6 is capable of. I can only imagine the time and effort you've invested in it. Brilliant...

OLE Drop events not working on FrameW

This problem happens only after compiling an app, not in the IDE. In the IDE it's all OK.
It seems that, differently from an ordinary frame, on a FrameW the events OLEDragDrop and OLEDragOver are not triggered when dropping something.

As a workaround, a picturebox inside the frame does the trick.

OptionButtonW Click not raised when Owner Draw mode set

When an OptionButtonW is set to be OwnerDraw, the Click event isn't being raised. The value still seems to be updating though.

To reproduce:

  • Open up the demo app
  • Change OptionButtonW2 in Main form to be Owner Drawn. Add a Click hander to update the caption
  • Run it and if you click OptionButtonW1, then where OptionButtonW2 is you see OptionButtonW1 is no longer selected but no click event was raised for OptionButtonW2

RichTextBox - multiline and selection

There seems to be a bit of an odd behaviour in the RichTextBox compared to the standard one.

.SelStart and .SelLength seem to return indexes based on the text using just a single new line "\n" (vbLf), where as the .Text uses return as well, "\r\n" (vbCrLf).

You can see it in the RichTextBoxForm sample if you add this code:

Private Sub RichTextBox1_KeyPress(KeyChar As Integer)
    Debug.Print RichTextBox1.SelStart & " out of: " & Len(RichTextBox1.Text)
End Sub

If you run it and just add text to the end of the first line, it's fine they both match up.
But when press enter, it become different by 1, and gets further out for each line break.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.