« first day (742 days earlier)      last day (2438 days later) » 
00:00 - 18:0018:00 - 00:00

18:04
hi @Tim!
Tim
Tim
hi... wish I'd seen rubberduck when I was doing the last few years of VBA development in Excel
lol, thanks!
Tim
Tim
saw it mentioned in the 2nd monitor, just noseying around...
we're hoping to make it actually useful in the near future :)
Tim
Tim
I'm not much of c# developer (F#, C++, Perl, javascript but only bits of C#) but after 2 or 3 years of fairly intensive tactical dev in Excel I'm wondering if I can help...
18:08
You certainly can.
We need bug reports, and I'm sure you can pick up enough to help in other ways quickly enough.
the scope of the project is basically to take over the VBE and improve everything we can about it - so there's quite a lot of not-yet-implemented ideas :)
In fact, there are as many people who don't write the code working on it as there are people who do.
Tim
Tim
Not used Antlr much but I've done other similar parser engines when it comes to handling VBA grammer
@Tim Awesome, that's one of the parts we struggle with most.
It isn't hard to pick ANTLR up.
It is actually kind of like XML or JSON, only in a different format.
Tim
Tim
it'd be more how it integrates into the rest of the code I guess, how it's being used etc
I did somework on uglifyjs - the tricky bit was figuring out what was being done walking the AST etc
18:12
@Tim that exact part is scheduled to be pretty much redone soon, @Hosch250 wants to implement some kind of tree structure a la Roslyn, so we stop needing to parse an entire module whenever a comma changes somewhere
so, good timing :)
Tim
Tim
incremental parsing can be a pain... I'm trying to think if there's anything in VBA that would make it so...
(don;t know if you've ever done much perl, but the syntax is deliberately ambiguous and the way a statement is parsed can change completely by what declarations have gone before)
the real hard part is resolving identifier references; whenever we parse one module, we don't know whether identifier references in other modules need to be added or removed, so we re-walk every parse tree (one per module) just to re-resolve identifier references everywhere. it works, but it's terribly inefficient.
Tim
Tim
I used to have a perl program that, by design, would 50% of the time fail to compile... just to show the principle :)
yep, and all the globals.... you know ThisWorkbook for example is NOT a universal global... but simply the default name for each workbook
renaming it in the IDE is a good way to break a lot of VBA code :)
yep
lol
one thing we're struggling with, is determining the underlying type of a document-type module, e.g. knowing that ThisWorkbook is a Workbook object, without having to write any host-specific code to do it
Tim
Tim
um... what access do you have to the VBA internals ?
18:19
Not too much, AFAIK.
We are mostly just using the API available.
everything that's exposed through the VBIDE API, and everything Win32 can get us
Tim
Tim
I used to write the odd Visual Studio add-in but then they kept replacing all the API's for doing that....
We have one contributor familiar with Win32.
familiar? lol, I suspect @Comintern wrote Win32
Tim
Tim
ha... I remember Win32... and Win16... and ... [cough cough]
18:20
@Mat'sMug - At this point, I doubt anyone would cop to writing Win32.
Tim
Tim
I was writing C++ class libraries to wrap up the WIndows API before Microsoft had a C++ compiler...
Tim
Tim
also had a good time writing to the Win32 API directly from perl....
Woah. I've seen some of our pre-MFC code here at work. Ugly stuff.
Tim
Tim
18:22
a large part of the MFC team were poached directly from GlockenSpiel CommonView ...
which wasn;t very good, but did a wrapper of the basics for Mac, Win3 and OS/2 !!
they never really got up to speed with Win 3.1 tho...
I can't find fm20.dll on my disk :(
Tim
Tim
anyway... hacking the odd API aside... I'll have a nosey thru the project and see what I can spot...
It says it is in C:\Windows\System32\
I looked in the SysWOW64 folder too
ooooh @Comintern wasn't there something about the path of project references not necessarily pointing to the correct place?
geez, no wonder nobody ever made something like Rubberduck for the VBE... everything about VB6/VBA is throwing every single curveball it can
Tim
Tim
I seem to remember a couple of things for VB6 ... one to make the mouse-wheel work in the editor :)
and there was another couple of addins, but I didn't use them that much...
18:29
MZ-Tools
Smart Indenter
Tim
Tim
that sounds familiar...
the Smart Indenter folks gave us their VB6 legacy code, we translated it to C# and it's now part of Rubberduck
and the MZ-Tools author was here a few months ago:
Apr 21 at 22:09, by Carlos Quintero
Just wanted to say that you all are doing an incredible job on Rubberduck
Wait, what? The path of project references can be wrong? How the hell does the VBE find them?
Tim
Tim
I used to wrap up my perl code inside a Windows Scripting Host wrapper and then plug that into the IDE via some pretty basic interfaces.... meant I had a text (no compile) scripting language wrapped in a COM layer that plugged into the editor... and a better language than VBA for doing it :)
Found it.
How the heck does it?
18:32
@Hosch250 where was it?
C:\Program Files\Microsoft Office\root\VFS\System\
Is it registered?
Virtual File System...
my references dialog says "c:\windows\SysWOW64\FM20.dll"
@Comintern How can I tell?
18:34
Search the one of its GUIDs in the registry.
And VBE7.dll is in "C:\Program Files\Microsoft Office\root\VFS\ProgramFilesCommonX64\Microsoft Shared\VBA\VBA7.1\"
It is in Office's Virtual File System.
we're going to have to fetch the actual path from the registry to have a reliable solution are we?
#Curveballs
My FM20 is corrupt, I think.
It crashes OleWoo every time.
@Hosch250 meaning the path you found it under is the path of the project reference?
when we implement this dialog, let's list the actual freakin' path there
@Hosch250 - PE Explorer can open it. What are you looking for?
18:39
@Comintern The contents.
//Microsoft Forms 2.0 Object Library
//Version: 2.0
MSForms;
GUID = {0D452EE1-E08F-101A-852E-02608C4D0BB4};


Alias OLE_COLOR;
GUID = {66504301-BE0F-101A-8BBB-00AA00300CAB};
I4

Alias OLE_HANDLE;
GUID = {66504313-BE0F-101A-8BBB-00AA00300CAB};
I4

Alias OLE_OPTEXCLUSIVE;
GUID = {6650430B-BE0F-101A-8BBB-00AA00300CAB};
Bool

Interface IFont;
GUID = {BEF6E002-A874-101A-8BBA-00AA00300CAB};
property-get Name(out pname: ^BSTR): HResult; stdcall;
property-put Name(pname: BSTR): HResult; stdcall;
property-get Size(out psize: ^CY): HResult; stdcall;
@Comintern Can you determine whether it references another dll?
@Comintern beats me how chat allows pasting that, but complains with "message is too long" if you actually type 301 characters
Only imports I see are OLEAUT32, GDI32, KERNEL32, ADVAPI32, and OLE32.
That doesn't mean that the tlb doesn't refer to other tlbs though. I'd need to tease that out with code.
soo...we're at weekly-ish releases now?
18:48
@Hosch250 vbQueryClose isn't defined in the MSForms library, but the VBA standard library - do MSForms declarations get loaded at all?
@Hosch250 - Almost missed it. There are 2 typelibs in there. Looks like the 2nd one has all of the controls in it.
@Mat'sMug Yes, they do.
//Microsoft Forms 2.0 Object Library
//Version: 2.0
MSForms;
GUID = {AC2DE821-36A2-11CF-8053-00AA006009FA};


Alias OLE_COLOR;
GUID = {66504301-BE0F-101A-8BBB-00AA00300CAB};
I4

Alias OLE_HANDLE;
GUID = {66504313-BE0F-101A-8BBB-00AA00300CAB};
I4

Alias OLE_OPTEXCLUSIVE;
GUID = {6650430B-BE0F-101A-8BBB-00AA00300CAB};
Bool

Interface IFont;
GUID = {BEF6E002-A874-101A-8BBA-00AA00300CAB};
property-get Name(out pname: ^BSTR): HResult; stdcall;
property-put Name(pname: BSTR): HResult; stdcall;
property-get Size(out psize: ^CY): HResult; stdcall;
so we should have the events then
@Comintern We are loading the controls just fine.
@Mat'sMug We have most of them.
18:48
Woah. That was a bigger paste than the first.
All but about 5.
@Comintern We are getting those.
Hmmm... I wonder if the collector is only reading one of the two typelibs in that file.
@Comintern What's the other?
It's the other one I just pasted.
They're slightly different. Lots of duplicate member names, but the GUIDs are all different.
Well, neither of them have FormEvents.QueryClose.
Or FormEvents.Initialize.
18:52
Initialize (and Terminate?) would be inherited from the standard class module interface I'd think
Oh, that makes sense. What about QueryClose, though?
got anything about Click, Load, Resize?
Yes, those are all loaded correctly.
Wait, no.
Everything in this list is loaded:
Dispatch FormEvents;
GUID = {5B9D8FC8-4A71-101B-97A6-00000B65C08B};
function AddControl(Control: ^Control); stdcall;
function BeforeDragOver(Cancel: ^ReturnBoolean; Control: ^Control; Data: ^DataObject; X: R4; Y: R4; State: fmDragState; Effect: ^ReturnEffect; Shift: I2); stdcall;
function BeforeDropOrPaste(Cancel: ^ReturnBoolean; Control: ^Control; Action: fmAction; Data: ^DataObject; X: R4; Y: R4; Effect: ^ReturnEffect; Shift: I2); stdcall;
function Click; stdcall;
function DblClick(Cancel: ^ReturnBoolean); stdcall;
Load and Resize, no. Click, yes.
TFL, BBL.
18:55
Return[Type] values are the biggest fraud in VBA
they make a ByVal parameter look like an ordinary value, but they're objects
@Mat'sMug - Given the number of frauds in VBA, that's saying a lot.
lol
Sub DoSomething(ByVal cancel As ReturnBoolean)
   cancel = True 'assigns the default member's value, not the reference
End Sub
I hate default members
@Vogel612 ish, yeah
19:10
@Hosch250 - All of the constants for those events are in msvbvm60.dll - still trying to track down the elusive ThunderForm typelib.
@Comintern Which folder?
I think I'm going to have to load it explicitly if we reference FM20.
That's in SysWOW64 for me - it's probably going to be in system32 for a 32 bit OS though.
Yeah, same here.
I was looking in the VFS.
@Mat'sMug I found the aliases!
They are defined in _HiddenInterface in msvbvm60.dll.
[restricted, helpcontext(0x000f653e)]
void _stdcall Left();
But restricted means they are hidden... How does this work?
Pretty sure that's the same way they're laid out in VBE7.dll IIR.
@Hosch250 oooh nice!
In other words, we're getting to the point where we need to dive into VBA itself... like, the runtime library. Geez.
19:24
@Comintern I can't find Initialize in there.
It isn't implementing IClassModuleEvt is it?
UserForm? Can you check? I can't open FM20 for some reason.
> The indent format doesn't work with IF... ELSEIF... ELSE... END IF statement.
What about Load, though? And QueryClose?
I can't see the implemented interfaces on my work machine.
19:27
What are you using to look at this? OleWoo isn't working.
I'm using PE Explorer.
Although the VS OLE viewer might be able to open them.
Where do I get OLE viewer?
Do you have the Windows SDK installed by chance? It's in there.
Not sure.
> Thanks! Got sample code to reproduce the issue?
19:30
Older version of VS used to ship with it too IIR. The executable name is oleview.exe.
@Duga @Comintern is that a known issue?
It might have been fixed with #1789.
This is real encouraging:
There is one known issue that has an ignored test case.
19:34
@Hosch250 someone's definition of "correctly" needs to be revised lol
Public Sub Test()
	If _
		Foo = True _
					Then
		Debug.Print
	End If
End Sub
If he's doing that, he should be smacked though.
That's the If...Then... that's known to be broken.
oleview gives that same error every time I try to view a specific file.
> Also, it would help if you can upload your rubberduck.config file (should be in C:\Users{user}\AppData\Roaming\Rubberduck) or a screenshot of your indenter settings.
19:42
I'm thwarted at every turn. PE Explorer only opens x86 .dlls...
@Hosch250 - Are you running the 64 bit version of oleview? VBA shouldn't be using any 64 bit dlls AFAIK
@Comintern I tried both x64 and x86.
And what about PE Explorer?
oleview wouldn't open any files.
PE Explorer told me to get an x86 version.
I could have sworn that I ran across that typelib a couple weeks ago...
Interestingly enough, the fm20 header says Beta on it.
Has it been in beta since the last update years ago?
public PnlOleText(SetTextDelg s) : this() // makes the c++ me weep.
{
    _std = s;
}
Wait a second, if you look at the UserForm class in the VBE object browser, Initialize, Terminate, and QueryClose aren't listed as events. They have to be inherited.
19:55
@Comintern That's what I concluded from the dll.
Load and Resize too.
Got to walk my dog. BBIAB.
The odd thing is that the VS2013 object browser doesn't show the implemented interfaces - it usually does.
gut-feeling at this point: Initialize, Terminate, Load and QueryClose were hacked-up hard-coded in there
esp. given vbQueryClose is defined in the VBA std lib
gosh what a mess
I'm thinking Initialize and Terminate are inherited from the generic VB Class class. Load and QueryClose probably come from some arcane MFC class someplace.
Except it's so freakin' old it appears to be written in ANSI C...
let's just hard-code them and be done with it, no?
I'd have to concur, I think. That's so fundamental to how forms work in VBA that it isn't going to change.
20:05
and we know the VBComponent.Type of form modules, so we can definitely handle this
actually we could handle it the way we're forcing DebugClass into the built-in declarations
As far as I can tell, Debug is entirely internal.
that method should be called PatchUpMissingComDeclarations
0
Q: VBA Retrieving items from array returning same item

TrevorComing from JS, I've realized the methods for working with arrays in VBA are very minimal. Because of this, I've created this mess of code to find the index of certain items within 2D arrays. The basic idea of this code is to go through a bunch of open reports, store them in an array, and pull th...

Found it with a hex editor in VBE7.dll. It's part of the DFrame class:
DFrame..Activate....Deactivate..Resize..QueryClose..Cancel As Integer,CloseMode As Integer......0ñ#.................´?..Initialize......Xñ#.................É?..Ter‌​minate.......ClientLeft..ClientTop...ClientWidth.ClientHeight........Name....Visi‌​ble.Ðñ#..DÁ€...ú:...........}A......RightToLeft.Move........SetFocus....ZOrder...‌​........... ò#...........$.õ>......Hide....<ò#...........$..?..PrintForm...\ò#
wow
so yeah, let's hard-code the declarations and move on :)
20:14
Yep. It's been deliberately left out of the typelib.
I wonder why
Probably so they can't be instantiated through OLE.
Set foo = New DFrame '{Shudders}
@Hosch250 let's have an IDeclarationsProvider interface and implement a class whose role will be to spit out an IEnumerable<Declaration> with all the built-in declarations we can't get through the COM collector
e.g.
public interface IDeclarationsProvider
{
     IEnumerable<Declaration> Gimme(); // hmm somehow would be nice if the COM collector could implement that interface too
}
then let's move the Debug and Err stuff into an implementation of it
and make the COM collector (or the parser?) take an IEnumerable<IDeclarationsProvider> dependency and just multi-bind all implementations with Ninject so we can just iterate them all and generate all the Declarations we need
that way when we come across new built-in declarations we need to add, we can just implement that interface and it'll get picked up automagically
@Hosch250 and then review all inspection issues, stabilize rename refactoring as much as possible, release and move on to that tree thing
20:30
@Mat'sMug I'm planning on another beta release tonight. Maybe stable next week.
@Hosch250 cool
Heck, how do I know how to get this stuff?
For now, I could just hard-code the name into the event finder.
14 mins ago, by Mat's Mug
@Hosch250 let's have an IDeclarationsProvider interface and implement a class whose role will be to spit out an IEnumerable<Declaration> with all the built-in declarations we can't get through the COM collector
we want the missing events, but also the missing methods and their parameters too
Right.
Which missing methods?
> Found it.

```vba
Private Sub Testing()
If Foo Then Bar Else
Baz
End If
End Sub
```
...indents to...

```vba
Private Sub Testing()
If Foo Then Bar Else
Baz
End If
End Sub
```
20:34
22 mins ago, by Comintern
DFrame..Activate....Deactivate..Resize..QueryClose..Cancel As Integer,CloseMode As Integer......0ñ#.................´?..Initialize......Xñ#.................É?..Ter‌​minate.......ClientLeft..ClientTop...ClientWidth.ClientHeight........Name....Visi‌​ble.Ðñ#..DÁ€...ú:...........}A......RightToLeft.Move........SetFocus....ZOrder...‌​........... ò#...........$.õ>......Hide....<ò#...........$..?..PrintForm...\ò#
SetFocus, Hide, PrintForm, etc
OK.
We already have a static class CustomDeclarations.
The Load method returns the list.
@Mat'sMug Are these all subs, or are any functions?
subs AFAIK
wait a sec
wtf is this???
No idea.
20:39
class _Form in library Unknown1
..which can't be navigated to because it's not referenced
Unknown1? WTF?
Well, I'll add the events for now.
yep, "WTF" is correct
@Hosch250 ok. we need their parameters too, ideally
Sure thing.
you can just copy whatever you get from the VBE itself
20:40
Private Sub HadToTryIt()
    Dim foo As Unknown1
    Set foo = New Unknown1
    foo.PrintForm
End Sub
Activate,
Deactivate,
Initialize,
QueryClose(Cancel As Integer, CloseMode As Integer),
Resize,
Terminate
wow, did you know if you add empty handlers for all form events, and only write code in one of them, that the VBE removes the empty handlers when you compile?
@Hosch250 oh right, just the ones we're not picking up from the MSForms type lib already
@Mat'sMug This is why I refuse to learn VBA.
When I write code, I want it to stay written.
well technically it's code the VBE wrote, so...
Oh, empty ones only?
20:44
yes
Yeah. Did I ever tell you that it sets the project name to VBAProject if you save it with code, then remove the code and resave?
It might take a restart to trigger it.
but it doesn't do that for worksheet events
must be something in the form designer... geez VBA what's wrong with you?!
5
@Mat'sMug Hmmmm that kinda makes sense to me... perhaps I could work at Microsoft. At least now I can stop deleting them...
only in forms
#didyouknow that the VBE automatically removes empty event handlers in UserForm code-behind when you compile? #VBA #TIL
TTQW
21:00
TTYL.
21:26
> Here is the sample formatted codes:
![2016-06-17 14_23_21-microsoft visual basic for applications - ap-sd development - modedi2 code](https://cloud.githubusercontent.com/assets/4174897/16165155/2a457116-3497-11e6-8a55-b725b2f618a0.png)

And here is my setting:
![2016-06-17 14_24_49-settings](https://cloud.githubusercontent.com/assets/4174897/16165192/60d10aa6-3497-11e6-980a-d7a3e5549352.png)
Thank you.
21:51
@Duga nice arrow code
@Mat'sMug Can you review my two PR's before I release?
I'm writing release notes now.
@Duga Unless there's something funky going on in the cut off screenshot, that issue was fixed with #1789.. Mine however...
@Duga from my phone that looks ok; did you test to see if it actually worked?
These could be loaded harmlessly in a unit test, too
@Mat'sMug Of course, but I forgot to run the tests.
22:05
wristslap
@Comintern awesome!
Yours is a bloody edge case lol
What about the other one?
Merge pull request #1859 from Hosch250/Issue1851

Hard-code a few missing declarations
> Closes #1826
[rubberduck-vba/Rubberduck] Hosch250 pushed commit 6212386b to next: Close #1826
[rubberduck-vba/Rubberduck] web-flow pushed commit 56c4b55b to next: Merge branch 'next' into Issue1826
[rubberduck-vba/Rubberduck] Hosch250 pushed commit 6a6720f0 to next: Fix bug.
[rubberduck-vba/Rubberduck] Hosch250 pushed commit 89ade926 to next: Merge branch 'Issue1826' of github.com/Hosch250/Rubberduck
@Hosch250 which other one? ;-)
Merge pull request #1834 from Hosch250/Issue1826

Close #1826
[rubberduck-vba/Rubberduck] build for commit 74ad470b on next: AppVeyor build succeeded
22:16
OK, I've got two hours until release.
I know, I'll finish 1616.
[rubberduck-vba/Rubberduck] build for commit 6b7f1d7c on next: AppVeyor build succeeded
2.0 beta update 2 coming up, in a few hours! More source control fixes, indenter fixes, resolver fixes, inspection fixes...
23:19
Down to 5 days / 22% issue resolution / opened issues
[Hosch250/Rubberduck] Hosch250 pushed commit b9e14ea9 to Issue1616: Make CE selection stick
> Close #1616
[Hosch250/Rubberduck] Hosch250 pushed 25 commits to Issue1616
Merge pull request #1859 from Hosch250/Issue1851

Hard-code a few missing declarations
Merge pull request #1834 from Hosch250/Issue1826

Close #1826
[Hosch250/Rubberduck] web-flow pushed commit 7eed5838 to Issue1616: Merge branch 'next' into Issue1616
Gotta run two AppVeyor builds, merge that, and release.
45 minutes left for today.
@Mat'sMug Do you think I've been worth my 300 hours?
You just have 150 left (well, until I run out of reports to send my instructor).
According to my calculator, you'll get 240 more hours (a full 90 above the required number--over two full weeks!) than the minimum.
[rubberduck-vba/Rubberduck] build for commit b9e14ea9 on unknown branch: AppVeyor build succeeded
@Mat'sMug great work guys! really looking fwd to it :-D
23:34
@Hosch250 - Hold off a couple minutes on the release build, PR to close #1858 on the way.
[rubberduck-vba/Rubberduck] Hosch250 pushed commit 52fb48d2 to next: Mostly close #1759. Just have to retain the selection.
[rubberduck-vba/Rubberduck] Hosch250 pushed commit b9e14ea9 to next: Make CE selection stick
[rubberduck-vba/Rubberduck] web-flow pushed commit 7eed5838 to next: Merge branch 'next' into Issue1616
Merge pull request #1860 from Hosch250/Issue1616

Code Explorer Enhancements
[Hosch250/Rubberduck] Hosch250 pushed 9 commits to Issue1851
Merge pull request #1860 from Hosch250/Issue1616

Code Explorer Enhancements
[Hosch250/Rubberduck] Hosch250 pushed commit 7741c5b5 to Issue1851: Fix bug where userform events are loaded without FormEvents being loaded
@Comintern I'll wait for all of these PR's to merge, then do it. Going to have supper in a bit--probably have to wait for that too.
Everyone hold your thumbs.
[rubberduck-vba/Rubberduck] build for commit cad72f7f on next: AppVeyor build succeeded
@SlowLearner Can you give me a solid example of all the various ways to use Name? github.com/rubberduck-vba/Rubberduck/issues/1824
I'm probably going to tackle that next week, and I need to know how to do it. It looks like it is just Name + expression, but...
And what does that do, anyway?
@Hosch250 I don't think there's anything other than Name stringexpression As anotherstringexpression.
23:42
@Comintern OK, that should be pretty easy.
What does it do, though?
(Do I want to know?)
@Tim IIRC, there was a C++ compiler distributed with the Alpha release of Windows 1.0 (I have a copy somewhere)
Supper's on. Merge the PR's later.
@Hosch250 IIRC, you have to run OleView as admin the first time.
@Hosch250 I think the VFS stuff is only in Win10?
23:45
[rubberduck-vba/Rubberduck] build for commit 7741c5b5 on unknown branch: AppVeyor build succeeded
[rubberduck-vba/Rubberduck] build for commit bae40b73 on unknown branch: AppVeyor build succeeded
[rubberduck-vba/Rubberduck] build for commit 6025e447 on unknown branch: AppVeyor build succeeded
00:00 - 18:0018:00 - 00:00

« first day (742 days earlier)      last day (2438 days later) »