Results 1 to 40 of 4199

Thread: CommonControls (Replacement of the MS common controls)

Threaded View

  1. #11
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    7,653

    Re: CommonControls (Replacement of the MS common controls)

    Where is the IEnumVARIANT in your project coming from? I don't see it defined in the included OLEGuids and 'show definition' can't find it either. This needs to be explicitly referenced, because if you've defined it in another typelib with the standard declare from oaidl.idl (as it is in olelib.tlb), there's a type mismatch error and full VB crash as soon as you add a control to your form. Until it's specifically referenced I did a temporary fix by just removing it from olelib and recompiling the tlb, but in case I ever need it elsewhere I'd like to figure out a better solution.

    Edit: I'm still getting type mismatches at random times in the IDE when I interact with the TextBoxW control, trying to figure out what's causing them, I suspect another conflicting interface. Fixing IEnumVARIANT did make a difference; the errors are no longer immediate. I can force the error by renaming or deleting a standard textbox then clicking on the textboxw. really weird.

    Edit2: It's a handled error and changing break on all errors to break on unhandled errors stops the crashing, BUT; all the custom properties disappear. No '(Custom)', no Text, no OleANYTHING. This is just getting weirder by the minute. If I reload VB, they come back, until I do something to another textbox again.

    Edit3: That seems to be a problem with having the real windows common controls in the same project. It causes the disappearing properties issue even in the sample project--- but even for the TextBox, which is not part of that in vb.
    I may possibly have gotten a hint; I added the TabStrip to my form, restarted VB, and when I tried load the form it was on, I got a Type Mismatch error on this line in UserControl_ReadProperties:
    .Contents = PropBag.ReadProperty("InitTabs", 0)

    I'm unsure how to fix it though as there's only 1 PropertyBag type. I tried making it explicitly VBRUN.PropertyBag and adding CVar(), but no change.

    Edit4: Removing the reference to MS common controls did not fix the problem. I can create a new project, add the new controls, have them work fine, add a reference to MS comctrl, the new controls start losing properties/erroring, I remove the reference to MS comctrols, but the new controls no longer work even if deleted and added again even with a VB restart. Absolutely maddening.

    Edit5: Something else is causing an identical issue. I created a whole new project that never referenced MS comctl; error still happened. Really about to give up on this wonderful project and go back to manually doing it without user controls (which i had been doing since i hated ocx's and ctl's to begin with). The conflict is also coming from shell32 shell controls/automation reference, AND ms activex data objects 2.5. Everything good, add reference to one of those, no longer good.

    Trying to narrow it down a bit; this line is in VTableHandle.bas causing a type mismatch error. Whether it's the only one I don't know, but it's a clue
    Private Function IPPB_GetPredefinedStrings(ByVal This As Object, ByVal DispID As Long, ByRef pCaStringsOut As OLEGuids.OLECALPOLESTR, ByRef pCaCookiesOut As OLEGuids.OLECADWORD) As Long
    and also Private Function IPPB_GetDisplayString(ByVal This As Object, ByVal DispID As Long, ByVal lpDisplayName As Long) As Long
    and presumably the other IPPB_ function
    [...]
    Set ShadowIPerPropertyBrowsingVB = This
    Last edited by fafalone; Nov 19th, 2014 at 08:41 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width