00:00 - 19:0019:00 - 00:00

12:00 AM
[rubberduck-vba/Rubberduck] 2 opened issues. 1 closed issue. 12 issue comments.

@Comintern yes!

Should be pretty easy to implement too.

12:17 AM
There is an open issue for that already. Except its called Locate in Code Explorer
@Comintern I agree that it is sufficient but do consider that you might need to open the containing foldet.

Oh, sure. But I'd only open up to the component level. If the component node was closed, it would sync to the component. If the component node was open, it would sync to the declaration inside the module.

12:55 AM
What good is documentation if nobody reads it. :barf:
I now understand why people get irked and respond with RTFM.

2 hours later…
2:44 AM
Got some nifty work done on my training app/fiddle combo.
You can check it out at github.com/Hosch250/CodeNameCurlew.
Note that nothing about the left sidebar works yet.
And CTRL-S saves the document. Execute does not (yet).
And I won't say it's 100% stable.
Wheee! Execute saves!
It gives you the compile errors and all.

3:22 AM
Release is going well so far.
I think I'll start out the "training" part with the keywords and operators.
And input/output.
Let's see. Input/output first, probably. Then ifs/loops/methods.
Then keywords/operators individually.
Good morning, @Vogel612.

Good night actually

Oh, OK.
It must be like 4AM over there, or something.
Night!

3:40 AM
Actually other civilisation real don't care if you use nukes. They only care if started the war or not. You can carpet nuke the enemy, capture all his cities and sell them of to the highest bidder, which will give you massive amounts of gold for it. — user38485 Dec 17 '12 at 9:12
I don't have the BnW expansion yet, but as of G&K I don't think nuking causes any diplomatic issues. — SaintSix_ Aug 9 '13 at 8:42

You there Hosch?

1 hour later…
5:21 AM
[rubberduck-vba/Rubberduck] build for commit aa014706 on unknown branch: AppVeyor build succeeded

@Hosch250 You mind looking over my stab at MVP?? github.com/IvenBach/Trying-MVP

4 hours later…
9:42 AM
> I am going to guess there is an issue on this already, but I can't find any, so apologies in advanced.

I recently installed rubberduck on a new machine and the rubberduck "interface" seems to be smaller than their containing windows. Here is a picture to illustrate:

![rubberduck_issue](https://user-images.githubusercontent.com/5611071/49929431-c78fca00-fec2-11e8-8c7e-01bc02a879a5.PNG)

I have seen this behaviour on before on my previous install, but it seems to have gone away when I re
> I tried setting scaling to 100%, then rebooting, and now it works fine, even with a second monitor. I would however prefer to have 125% scaling on my laptop if at all possible.

2 hours later…
11:31 AM
[rubberduck-vba/Rubberduck] Vogel612 is playing around with a project card
> Compare #4555 and #4230

1 hour later…
12:51 PM
@this what kind of deployment testing do you need? I run the AV builds on my machine at work and am happy to screw it up as needed. SWo long as there's someone around to act as screw extractor, that is.
@Comintern ahem
@this carp. Late to the party as usual...

1:29 PM
@FreeMan just pull from my branch and build

oh. need to do that at home, then.

@this Don't you need the C++ toolchain to build the installer?

can I For Each through a ParamArray, or do I need to For I = LBound(ParamArray) to UBound(ParamArray)?

@Comintern no, it is designed to not require it for development
Installer itself doesnt need it. It influences how the TLBs will come out

Gotcha. I should probably still install it at some point.

1:43 PM
If there is no vc tools, we use tlbexp.exe to create the type libraries, which cramps our style due to lack of control over how things should be exposed. But for typical development work, it really doesnt matter.

I keep putting off trying to make shims because I don't have the right tooling.

for example, a breaking change would be that tlbexp-exported build get fugly enum names whereas vctools-built build would get pretty names,
yeah, shims is a whole other thing, and we would have to distribute the shim dll in the source code to enable them to build without vc tools.

They shouldn't ever really need to change unless MS updates the VBE (not holding my breath).

> I know it's only tangential to the problem discussed... but I had very much the same issue one time and came up with the following function:

 vb
' Return the actual parameters from nested ParamArrays
Private Function UnwrapParamArray(ParamArray arrayToUnwrap() As Variant) As Variant()
Dim OutputArray() As Variant
Dim IntermediateArray() As Variant
If UBound(arrayToUnwrap) > 0 Then
OutputArray = arrayToUnwrap
Exit Function
End If
OutputArray =

Yep, just necessitates that the build process will handle it anywhere, anytime. Can't have it blocking a new contributor just because they didnt utter the correct incantations. ;-)

1:51 PM
^ That was driving me nuts.
The VBE's dialog doesn't tell you which open project you're working with.

@this maybe the problem is that @IvenBach has forgotten the correct incantations and is now uttering the utterly incorrect ones

@FreeMan yeah I know for a fact that my branch doesn't make any difference (nor did I expect to.)
Whatever IvenBach has going on is.... special.
Had a random thought. Is it even possible to install a VS without support for WPF/Winform?

@this Yes.

.... Then @IvenBach might want to double check that.

That's a separate selection on the installer, and it's not checked by default.

2:00 PM
That's 'cause Iven is special! just like the rest of us

If that's all what it was.....

@IvenBach I wouldn't put an IView interface on your model...

Yes, he did

For one thing, it's named wrong. For another thing, the model is just a DTO/POCO. It only contains data.

2:02 PM
:grabs the popcorn, waits for the pounding of heads on desks:

Models, as a general rule, don't get interfaces unless there are multiple model types that can be grouped into a more generic superset.

2:18 PM
@IvenBach I'd gone to bed, as you probably figured out :)

1 hour later…
3:46 PM
> Hi @Irubataru - could you try the following please?

If you're on Windows 8.1 or 10:
Go to Rubberduck Settings -> General and select "Set DPI unaware" then restart the application.

If you're on earlier Windows:
Set the DPI scaling in Control Panel to "Use XP-style scaling" (under Advanced options)

@Comintern hey that's the old ducky icon!

@MathieuGuindon best shoot that ducky dead.
@Duga eyeballing the screenshot, it looks like it's either Excel 2013 or Excel 2016.
Do we know if they made VBE in those hosts DPI-aware?

no clue. I'm totally DPI-unaware.
would be more likely for 2016 than 2013 though

@this It's wearing a bullet-proof vest.

@Comintern that's awesome :) ...if you actually name your projects

3:55 PM
@Hosch250 Which is why you always make a headshot. ;-)
@MathieuGuindon easy - make it an easter egg: I have a lame name because you were too lazy to name so sucks to be you

@this Complete with a limping duck walking across the window.

A great easter egg for that would be a "Rename Me" tooptip.

ha! only when the project name is "VBProject"

otherwise it just says "Active project name"

4:01 PM
@MathieuGuindon s/is/startswith

right

I really wish VS would do code folding on precompiler directives.

It does?

Is that a setting I'm missing somewhere?

Huh, no, it doesn't.
I could've sworn it did.

4:10 PM
I thought it did, too...

I usually never notice that it doesn't until things get a little... nesty.

FWIW, if you have to use precompilers, there's a good chance you are doing it wrong :)

Meh, for what I'm doing it's a lot faster than doing it right.

LOL.

I never have to see or use half my code again - that's a benefit of doing one-shots.

4:14 PM
one cheap trick would be to make it a partial class
(that only works if the precompiler directives are segregating at method level, not within method, of course)

Oh, they're segregating a bunch of stuff. I mainly use them to bypass specific time-intensive operations in certain debug configurations.

4:37 PM
@FreeMan Special is as special does.
@Hosch250 I'm going to try and fail a few more times before MVP starts sinking in.

Probably not as many times as I tried and failed.
FWIW, MVP and MVC aren't the best for ending up with clean code.
Even when you do them right, the view and/or the controller tend to grow uncontrollably.

Would MVVM be a better fit?

That's my favorite.

I thought to try it but lacking actual understanding couldn't get it to work.

hmm. I'm finding that the build/fluent/whatever pattern is sorta bleh on VBA.

4:53 PM
@this I haven't tried it personally - too much boilerplate in classes?

there's that but it's more the syntax.
this is what I'm looking at -- two ways to do this:
Public Sub Test()
Dim db As New DatabaseBuilder

db.FilePath("C:\foo\bar\baz.accdb") _
.Locale(dbLangGeneral) _
.AllowZeroLength(False) _
.Append _
.Append

With db
.FilePath "C\foo\bar\baz.accdb"
.Locale dbLangGeneral
.AllowZeroLength False
.Append
End With
the first variation is impractical because... line continuations.

Right. I kind of like the second one.

the second variation would allow for unlimited construction but it clutters the reading with all the With and End With
and in fact, is almost indistinguishable from the traditional approach where you just assign properties.

Both are better than db.FilePath("C:\foo\bar\baz.accdb").Locale(dbLangGeneral).AddTable("Foo").AddFi‌​eld("Bar", dbLong).AllowZeroLength(False).Append.Append

Granted but nobody would write code like that.... right?

4:56 PM
You must not have been on SO recently.

there's a reason why I don't read news. ;-)
the main gain for VBA would be for stuff like .AddField() where you can encapsulate the mandatory fields and allow further configuration of the optional attributes but beyond that, there's not much point in writing a Public Function AllowZeroLength(Value As Boolean) As FieldBuilder, I think.

So is the aversion to the line continuations a matter of maximum continuations, or clutter?

both, but mainly the former
the With variant is much more cluttered, though.

And the prettifier stops you from doing this:
db.FilePath("C:\foo\bar\baz.accdb")                                              _
.Locale(dbLangGeneral)                                                         _
.AllowZeroLength(False)                                                  _
.Append                                                                  _
.Append
Where number of spaces = just off the right margin.

and when you hit the 25, then what?
consider also that means much more formatting work.

5:02 PM
Realize your thing is too big to build fluently without another class?

.AddField() and .AddTable() actually return a different class
(which is also why the faux indentation)
and when you factor in boilerplate code, I think the best tradeoff in VBA is only to write builder-like functions for those that should return an object but otherwise treat the rest as ordinary properties.

.AddTables("Foo", "Bar")
.AddTableField("Foo", "Field2", dbLong)

ew. Doesn't feel "fluent" to me.

@this If this ends up being the problem...

@this It's pig-fluent.

5:05 PM
@IvenBach ALL of us are going to feel very dumb.
IKR?
so I'm thinking this is better:

this could get real fun
1

I'm sure this seems like a strange question, but one of my clients is having problems with Excel randomly crashing and giving the error message "Microsoft Excel has stopped working" (Problem Event Name: APPCRASH) while my C# program is using Excel (invisibly), and I'm trying to duplicate the prob...

With db
.FilePath = "C\foo\bar\baz.accdb"
.Locale = dbLangGeneral
.AllowZeroLength = False
.Append
End With
.Append
End With
End With

.AddAablesTay("Foo", "Bar")
.AddIeldFay("Foo", "Field2", dbLong)

Somehow when I last uninstalled and re-installed VS Enterprise was installed and not community. No wonder it looked slightly different.

I think that 's more idiomatic in VB while still being "fluent"

5:06 PM

@MathieuGuindon I guess he never heard of a null pointer....
(which goes to show how sheltered they can be when VB is all they know)

Just 50 min to lunch and the secret santa reveal

Also:
> my C# program is using Excel (invisibly), and I'm trying to duplicate the problem so I can figure out a way for my program to handle an Excel crash
One would think that the problem lies with that program....

Replace x = 1 with Application.Calculate. — Comintern 23 secs ago
@this IKR?

Just to make sure WPF is under .NET desktop development. Anything specific that needs to be added?

5:10 PM
IT"S ALWAYS EXCEL'S FAULT!

@IvenBach don't trust the package. Look at the list on the right hand.
IIRC there should be a component listed for both WinForm and WPF there.

@MathieuGuindon any particular opinion on what is most "fluent" for the VBA?

I don't see WPF in there.

@Hosch250 would it be under .NET desktop development tools? Really need to start paying more attention to what I install....

5:13 PM
Yes, it is.

@IvenBach just check all the boxes

Yeah, that should be good.

^^ easier. Providing you have the space to waste

I check all the boxes except Dotfuscator.

Total space required: all your SSD space are belong to us

5:14 PM
Better move 2 rows over to make room for that fat man coming.

I'm regretting not going with the larger SSD. VS doesn't let you pick the installation directory anymore, it seems.

I don't even see WPF under individual components.

@Comintern yeah
In-process C# code that throws an unhandled exception can get you an APPCRASH event. Are you sure you're looking at it from the right end? How would crashing the host from VBA code relate to the problem in any way, let alone help diagnose anything? What's that code doing? Questions saying "I need code that does X" typically don't tend to be a good fit for this site. — Mathieu Guindon 20 secs ago

It's under the ".NET Desktop development tools" header.
It's not listed individually.

5:17 PM
> Prerequisites

Visual Studio 2017 or later

Because it's not an optional part of it.

Yeah, this looks like it.

AFAIK if you can write a Win32 desktop app, you got WPF

So I don't think it's actually possible to install VS without WPF

VS is WPF
(right?)

5:18 PM
Sort of.
Parts of it are.

welp i hope so. VS is a big beast, and frankly I've been bitten before where my VS didn't have everything I thought it was supposed to have.
it's as if they enjoy playing shell game with you.

raises fist CHECK ALL THE BOXES!!!

"see the ball? now follow it as I shuffle the shells!"
of course, it's a fat man who does the shuffling. Being so fat, you have to stand on his belly just so he can reach the table (also on his belly in front of you)

LOL.

in Coding Projects and Factorio Heaven, 11 hours ago, by Phrancis
VS has the longest install time in the history of mankind. Over an hour and still going...

5:22 PM
Awesome trampoline.
@IvenBach VS 2019 preview was remarkably fast for me.

in Coding Projects and Factorio Heaven, 3 mins ago, by IvenBach
@Phrancis That's what happens when you check everything.

Damit.

Still fail on build. consistency++

Of course it wouldn't be this easy...
Private Declare Function GetCurrentProcessId Lib "kernel32" () As Long
Private Declare Function TerminateProcess Lib "kernel32" (hProcess As Long, uExitCode As Any) As Boolean
Private Declare Function OpenProcess Lib "kernel32" (dwDesiredAccess As Any, bInheritHandle As Boolean, dwProcessId As Long) As Long

Private Const PROCESS_TERMINATE As Integer = 1

Private Sub BuhBye()
Dim pid As Long, process As Long
pid = GetCurrentProcessId
process = OpenProcess(PROCESS_TERMINATE, True, pid)
I can't get a process handle with PROCESS_TERMINATE rights.

I think the only way to get that is if you actually launch it yourself
ditto with other rights.
but why not just use taskkill? That'd be out of process, too.

5:27 PM
It depends on the access control context assigned to the VBE, no?

@MathieuGuindon when all else fails...

I was thinking that I own the Excel process, so that would extend to the sub-process.

AIUI, you're not the host.

Not the case, apparently.
^^

after all, that'd be a security hole.

5:28 PM
Self denial of service?

nah. just simple sandboxing.
cos they got tired of VBE pooping all over, so they had to put in a litterbox.
2

Heh. I have another idea based on RD experience...
Subclass the VBE and chuck the handle.

@IvenBach I'm more than 1/6 of the way done with my F# book, and been too busy to read my microservices book (at home).
I think I'll finish the microservices one on vacation next week.
The F# one will probably be done by the end of January, I'm guessing.

@IvenBach tell your boss your computer's broke and you need new one.

5:35 PM
Thought's crossed my mind.
Although with RD unable to build it's forcing my hand to work on new things. Constantly leaving my comfort zone.

Yeah, that works.

Newing up a Model like that to supply it to the presenter is just part of passing the information from the view to the model.
Is there a rule of thumb as to what qualifies for business logic?

0

Stick your hands in it's stuff, twist them around, grab something soft and squishy, and then rip it out. This should do the trick: Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" _ (ByVal lpClassName As String, ByVal lpWindowName As String) As Long Private Declare Funct...

2

hmm. it might be me but I usually see models as mutable
and would be more likely to pass one in, then expect it back, which may be mutated or not then act upon it.

Yeah.
Although, I'm happy creating a model from within the view and passing it back.

5:47 PM
yeah, I can see situations where you don't have anything worth passing in (e.g. a data entry form with no defaults)

@Comintern awesome intro!

:-D

also kinda proves the point that there's literally a million different ways to get Excel to crash

IKR?
The intro is the answer - the code is just an example of that.

yeah
it's "its stuff" though ;-)

5:51 PM
Damit. Fixed.

6:11 PM
@Comintern what does hWnd = FindWindow(vbNullString, Application.Caption) do that hWnd = Application.hWnd doesn't?

@MathieuGuindon Nothing - I always forget that Application.hWnd exists.

Time for you to get a handle on things.

@Comintern glad to know I'm not the only one!

Although, including it makes it a general purpose "crash all the things" procedure.
Combine it with EnumChildWindowsEx, run it from the desktop, and it's Windows Update coded in VBA!

6:14 PM
i wonder - would that get picked up by AVs?

I doubt it. Only the ones that flag on any VBA code.

@Comintern LOL

I know that there are some AV that does some forensics on VBA code; I don't know how effective that is though.
OMG it deletes a file! VIIIRRRRRUUUUSSSS!

looking for Kill keywords in VBA code? yeah... uninstalls AV crapware

^

6:16 PM
@MathieuGuindon True (completely spaced that), although if you want to crash Word from Excel... Muahahaha! — Comintern 16 secs ago
Make'm fight.

yay got a new hat! ...and now I look just like Oz
(Oz du Soleil, the Excel MVP guy with funky hats)

nice, I like that I can uninstall 32-bit Office and install 64-bit Office and the ducky keeps on trucking!

@MathieuGuindon and a spiffy looking hat it is.

IKR!

You need your purple suit now.

6:33 PM
Mine looks oddly dissonant. Something about the top hat being a symbol of capitalism in the late 19th century.

lol
is WHERE columnA in (X, x+1) more or less efficient than WHERE columnA BETWEEN X and X+1 and/or WHERE columnA >= X AND columnA <= X+1?
assuming SQL Server
not that it likely matters much for a 1-off query, but I'll prolly run into again in the future
(where x is an integer)

IN(...) usually is equivalent to x = @1 OR x = @2`
the optimizer will do transformation all the time and generally speaking, those 3 forms should come out the same.
you can verify that for yourself by checking what execution plans you get; if they are the same, then the optimizer transformed them into a preferred common form.
If you do get a different execution plan, then it could not do the transformation for some reason and thus you can get different performance characteristics.
IOW: test, test, test, test, test, test!

IOW: #MaybeButItDepends

> I am just trying out the new version after bailing after having tried version 2.0 - and so far things have been flakey.

When I parse the first time, I get an Unexpected Error status in the toolbar, but no additional information that would help me track it down - the only option is to refresh.

And when I refresh I get the same status - first it says parsing error, then unexpected error

And when I click on Settings, it crashes Excel

6:50 PM
> And when I click on Settings, it crashes Excel
no bueano

> Did it happen to create a log file?

00:00 - 19:0019:00 - 00:00