VBA Rubberducking

This chat has moved to Discord: discord.gg/MYX9RECenJ
Nov 30, 2018 09:57
@MathieuGuindon oletools is neck-and-neck, at 698
Nov 29, 2018 18:25
Nov 28, 2018 08:51
Nov 28, 2018 08:50
Huh, my son wants me to change my avatar, bought me a present...
Nov 28, 2018 08:45
Solved by ITypeLib integration?
Nov 28, 2018 08:45
@Duga @Duga known issues???
Nov 28, 2018 08:44
Does, for example, VbWatchdog rely on window hierarchy to find windows? Eventually, we'd replace all of the built in windows with our own, and wouldn't need to use SetParent, although I suspect for the sake of the VBE working, we might have to keep them visible, but minimised.
Nov 28, 2018 08:42
@WaynePhillipsEA we're contemplating the idea of hosting all of the VBE windows in our own MDI child ToolWindow. For built in windows, we're thinking about setting their parent window to be our MDI child window, bit it concerns me that other add-ins might expect certain windows to have a certain parent.
Nov 28, 2018 06:43
TL;DR Windows/.NET provides all of the functionality you need to open the streams. If you want to be able to do the same thing on *nix, you need to write your own Compound Binary Format stream reader, which he has done.
Nov 28, 2018 06:41
I recently posted, at Mat, the general approach, and put a link to my CR question on the reflection approach.
Nov 28, 2018 06:40
It works on the old XLS format, the vbProject format and the FRX format. And it works with Access database files, something he doesn't support.
Nov 28, 2018 06:39
I started out that way, so as to be platform agnostic, but RD is tied to Windows anyway, so I just used reflection against ,.NETs RootStorage object (which .NETbuses pinvoke for, behind the scenes) and hey presto, I have access to all of the storages and streams inside the document.
Nov 28, 2018 06:38
@Comintern yeah, I have looked, his tool is designed to be command-line driven, and goes further than just decompressing the components.... It looks for base64 strings and other executable commands. It also opens the compound binary file format as per the unofficial specifications.
Nov 28, 2018 05:42
Call it, oh I don't know, TlbInf64?
Nov 28, 2018 05:41
@Comintern release The COM collector as a replacement for TLBInf32?
Nov 28, 2018 05:24
@Comintern you only need a few, just some offsets, and you're already close to where you need to be.
Nov 28, 2018 05:23
I guess we could skip it for now, as it's an edge-case, but we'd certainly want RD to be aware of, and inform the user, if the library is indexed, other than just the trailing comma and number.
Nov 28, 2018 05:21
There is a reference in the wiki called "The unofficial TLB specification* which I once dig into, skipping pinvoke, and read the binary header, found the embedded files and started reading a TLB. It can be done, one way or another.
Nov 28, 2018 05:19
@Comintern we can enumerate the objects in a DLL and determine which are TLBs?
Nov 28, 2018 05:18
@Comintern IKR back at you. The hassle of finding the TLB to open, then hoping OleView/OleWoo would open it, then using the awful UI, then copying and pasting the entire MIDL into Notepad++... Just to get you to bworking with the TLB.
Nov 28, 2018 05:15
@Comintern sure we can, If ResourceHacker keep can determine the indexes, which it can, then we should be able to do it too. I assume it's a pinvoke call.
Nov 28, 2018 05:14
@Comintern Having an OB would be tremendously useful, just for debugging Rubberduck, let alone for Rubberduck users.
Nov 28, 2018 05:13
One thing the VBIDE allows is referencing an indexed type library within a DLL. IIRC, you add a comma and the index number. It's one way that you can use a PropertyBag in VBA, by referencing an indexed library.
Nov 28, 2018 05:11
@Comintern I also think you asked for features of the add library/reference capabilities of VBE. You can of course use VBIDE to add and remove references, so you can technically add/remove/reorder references via code.
Nov 28, 2018 05:09
IIRC, the properties window is only refreshed if it is visible, so we can't necessarily read from the window itself, we'd have to source the data ourselves, based on the component/control. Should be straight forward for simple properties, but it gets hard when a control has PropertyBags
Nov 28, 2018 05:06
I don't know whether I'd prefer a themeable, feature-length, enhanced OB over a themeable, feature-enhanced Properties windoe Window. We have the data for an OB.
Nov 28, 2018 05:02
I forget whether I opened a discussion issue on this topic.
Nov 28, 2018 05:01
Ideally, RDMdiChildHack is the only window you need to have open, and everything else is a WPF window. But I think the VBE requires that the Project Explorer window be open, even if it's minimised, just so certain events like programmatically adding components are propagated.
Nov 28, 2018 04:57
Better color picker, font picker etc.
Nov 28, 2018 04:57
Consistent UI for one thing
Nov 28, 2018 04:56
I swing between thinking that making our own Properties dialog is going to be easy, to near impossible.
Nov 28, 2018 04:54
Neither the Page, nor the Tab, is directly accessible like other controls on the form, you have to use the Pages/Tabs collections to fetch them, respectively.
Nov 28, 2018 04:53
I discovered the other day that you can use the properties window to change properties of individuay Pages in a MultiPage control, but you can't edit properties of individual tabs in a TabStrip control.
Nov 28, 2018 04:51
But that chat reference was before I decided that ToolWindow might be a better approach, but I still think we call it that, even if it's only internally
Nov 28, 2018 04:49
Note the homage to MdiChildHack, with RDMdiChildHack
Nov 28, 2018 04:49
Sep 25 '17 at 15:51, by ThunderFrame
well, you have RdMdiChildHack, and you have the WinForms window RDIDE that you've injected into the RdMdiChildHack using SetParent. The controls and tabs inside the RDIDE don't know (or care) about what the parent of the parent is - they should just tear out as if they're hoted in a stand-alone WinForms window.
Nov 28, 2018 04:29
@this I agree.
Nov 28, 2018 04:27
The SetParent approach might be just one less Toolwindow to have to worry about tearing down, but IIUC, we don't use SetParent anywhere else.
Nov 28, 2018 04:26
The Toolwindow approach has merit, in that we kind of understand how to load them and get rid of them, and we can probably control whether the window is an MDI child and toggle it to floating (if we wanted to, but I'm not sure there's a need)
Nov 28, 2018 04:17
@MathieuGuindon I saw skimmed. But we discussed this while @Comintern was away. Are we injecting the window using SetParent, or, going with a dedicated Toolwindow that we set to non-dockable (i.e. the WPF host is a ToolWindow that we turn into an MDI child)
Nov 28, 2018 04:14
@Comintern I'm unsure if you made a decision regarding the library icon, but fugue has a search capability on his website. There's a few entries for books, and a few entries for folders, that might work like brown-books and folders-stack
Nov 28, 2018 04:12
I'm not getting a chance to catch up on the full transcript these days, but am going to tackle the last 24 hours because Avalon, so expect some belated comments/, questions from me.
Nov 28, 2018 04:08
Ah, yes, refreshed mobile chat, and now it's there.
Nov 28, 2018 04:07
Did I post a message in here to Wayne? I can't see it, but I could swear I did. About identifier tables.
Nov 28, 2018 03:59
@MathieuGuindon I was thinking of somebody else that's got experience working on open source development tools, and needs to improve their SQL server skills. Cough, Cosch
2
Nov 28, 2018 03:53
The SQL Server tools team - my team - is hiring developers. This is a great group and you get to work on modern, open source software. If you are even a little interested, apply right now, and drop me a DM telling me you did. https://careers.microsoft.com/us/en/job/550517/Software-Engineer-II
Nov 28, 2018 03:30
@WaynePhillipsEA got any clues about the binary bits that accompany the identifier names in each project's identifier table? I assume they indicate some kind of usage category (i.e. it's a function/declaration/scope/etc. keyword) and maybe a usage count or a system/user defined flag?
Nov 26, 2018 20:38
@Comintern There's a little man hurriedly stuffing values into pigeon holes.
Nov 26, 2018 00:12
And finally, I've got a script for the SyntaxHighlighter that is optimised for VBA. Rubberduck News currently (sometimes) uses SyntaxHighlighter, but with VB syntax rules.