« first day (1473 days earlier)      last day (1707 days later) » 
00:00 - 18:0018:00 - 00:00

6:00 PM
WM_CHAR doesn't fire on e.g. DELETE, or CTRL
 
so you must consult the API documentation (e.g. the links I posted) to see what it has
that's the WM_KEYUP
 
KEYUP != CHAR
 
Why aren't you listening to key up, @MathieuGuindon ?
 
because when you type something, you expect the editor to respond to the key being down, not up
 
6:01 PM
@MathieuGuindon Then use WM_KEYDOWN...
 
@Hosch250 guess what I'm using
 
You just said WM_CHAR.
 
@Hosch250 I'm not seeing where the ctrl is signaled.
 
11 mins ago, by Mathieu Guindon
also... AC is handling WM_KEYDOWN and WM_CHAR
 
6:02 PM
It isn't CTRL exactly, but it does have a flag that CTRL, SHIFT, or ALT is pressed.
 
the documentation simply says wParam refers to a virtual key code. No mention of any flag.
 
GetKeyState gets the state of modifier keys for a given keycode
 
@awgaya ah, yes
@Hosch250 i.e. useless to hijack the WM and inject Ctrl+i into the messenging pipeline
 
but in this case, we're talking about sending window message
 
I guess there's always SendKeys
 
6:04 PM
@this wFoo the w stands for word? IE uint? Whereas lFoo the l stands for long?
 
@IvenBach good question. no idea
 
Still struggling to understand MSDN documentation.
 
I think it's more likely that it's a legacy carryover
 
@awgaya bookmarked
 
maybe at one point it did mean word but nowadays it doesn't.
 
it probably meant "word" back when a pointer was 16 bits
 
what about that, I guessed it!
 
@Hosch250 That's what I inferred from msdn.microsoft.com/en-us/library/aa383751%28VS.85%29.aspx but I've been wrong before. Only once though!
 
#ProTip: If you are not sure why they did this thing, chalk it up to #LegacyHappens
 
6:07 PM
> Any other points to consider.
Usually Anti Viruses are not happy to see Set Windows Hook
meh. we're already knee-deep down that aisle
 
LOL.
 
and @IvenBach as a reminder, your only authoritative guide for windows data types is the MSDN article on Windows Data Types.
@MathieuGuindon Wayne mentioned months ago that there's a difference
 
between?
 
trying to find it
 
@this Noted.
 
6:11 PM
the key is to use process, not global, it seems.
 
Jan 1 at 15:34, by WaynePhillipsEA
I'm not really fond of the system-wide hot keys TBH. I don't think anti-virus products like that sort of thing either
right
 
so using SetWindowsHookEx would actually be an improvement.
 
maybe that'll make you like Symantec for a change! :p
 
nope. not a chance.
it might make Symantec like RD a bit more though
 
6:14 PM
come to think of it, i wonder if that factors in making code signing certificate useless....
(they have a funny notion of what constitutes a "trusted software", AFAICS)
(and not just Symantec, either)
 
> Anything you do to "make the VBA code secure" will be defeated within seconds by anyone that wants to "get in": putting a password on the VBA code is about as secure as locking your screen door - it keeps the bugs out, but if that's the best you've got any burglar is going to pee their pants in laughter as they cut through the screen like a hot knife in butter.
 
@MathieuGuindon You mean if I put a password on my VBA code, it won't have bugs anymore?
 
yup. that's exactly what I said. </nope>
 
Nope. The password keeps them from getting in.
 
@IvenBach Right.
I password-protect it, then start writing code.
Thanks for the clarification.
 
6:38 PM
Duck check: Is Range().FormulaR1C1 = "foo" the default for the macro recorder? I would have sworn it's Value.
 
you password-protect it, then you can't write the code. so you unprotect it. then re-protect it for distribution. then unprotect again to make a bugfix, re-protect to release the bugfix. #PITA
 
Have I just become so used to using .Value that I've convinced myself?
@MathieuGuindon That's why you include your password with the file... Duh. Make it easier when you need to unlock it next time.</joke>
 
@IvenBach by making it FormulaR1C1 the recorder doesn't need to tell whether you've entered a formula or not - it'll "just work"
@IvenBach might as well
 
@MathieuGuindon That's the default I'm getting on several computers. Is that how it's always been?
 
I'd think so.
 
6:43 PM
There's this... spreadsheet1.com/… Works by deleting all the p-code from the workbook, leaving just the compiled code. Trouble is, if you open the workbook on a different architecture, it has to recompile. Which it can't do, because some fool deleted all the p-code... /facepalm.
 
6:54 PM
That strikes me as an XY problem solution.
 
7:25 PM
@mansellan "[5] The converted file can only be run in the same PC and in the Excel (or PowerPoint) version used for its compilation. " "can only be run in the same PC" So... what you're doing is protecting it from yourself.
 
@mansellan FWIW, removing the p-code was the most logical thing they could have done to enable protection of the source code. In Access' case, you do have to have the .accdb file, then build the .accde on 32-bit Access, then again on 64-bit Access, then distribute the respective .accdes. There basically is no Any CPU setting.
@FreeMan In Access' case, an .accde compiled in Access 2010 32-bit can be opened by any other Access 32-bit versions equal or later than 2010; the same file would be unopenable in an Access 2007.
But the real problem, IMO, is the references. A VBA project embeds the full path to each library. Therefore, if they are not the same on the target computer....
 
@this Maybe that's just a language thing, then where "same PC" actually means same OS version & bitness
 
which makes anything that relies on external library (a common candidate is the common control library for example) fragile. If one PC has a different version of the mscomctl.ocx than another PC, then....
It should. At least I'd hope that is how they'd implement that technique for Excel/PowerPoint.
(never used it, so can't say if it's implemented the same way it is w/ .accde.
 
@this Yep I agree its about the only thing possible. I just wouldn't want to work somewhere that had to use it. Pain, pain and more pain...
 
7:38 PM
Hey, that's why I like my belts and suspenders!
and overalls.
and coveralls.
and overcoats.
and umbrellas.
 
Heh, if/when RD gets plugins we could probably eat their lunch...
 
7:54 PM
@this don't forget the long-johns
 
lol, would love to see their face when RD uses the typelibs api to populate the code explorer
 
@MathieuGuindon lol :-)
 
> It looks like procedure DoSomething is missing its VBA source code. Would you like Rubberduck to reverse-compile the P-Code into VBA source?
jaw drops
actually, the VBE does that all the time... whenever a line is typed in
source VBA -> p-code -> "pretty-print" -> editor
IIUC
 
well, there's 7 levels or so
 
@MathieuGuindon LOL
 
8:01 PM
and if I remember, only 3 of those are to do w/ source code; 4 with the actual p-code. Pretty printing need not go that deep.
 
@MathieuGuindon Now we are getting deep into black-hat territory ;)
 
Not necessarily. That can be still be white-hat.
 
First place, I was just kidding. Second, who doesn't want to be a black-hat?
 
The lost & found hasn't gotten back to me when I reported about my sense of humor.
 
@this :)
 
8:03 PM
Iiuc, whats left is close to what vb6 emits when targetting native. Tricky to decompile, symbols are lost.
 
@mansellan Yep. It's probably optimized, potentially inlined...
 
@mansellan hm, they should always have source files.... Else, they are probably hacking someone else's work?
 
Hence my black-hat comment.
If someone took the trouble to destroy that, they probably don't want it re-revealed.
 
IDK if that's generally true but for .accde w/o source files, the story is usually "we had a guy doing access stuff years ago and he left and we kept on using this project but now we need to upgrade and all we have is .accde"
 
8:06 PM
^
but if the best you get is obfuscated VBA code, I'd rather not
 
For VB6 (and general purpose languages), the story is usually different
I don't know how many people use VB6 in-house compared to commerically?
 
fewer than yesterday, more than tomorrow
 
^ true dat!
 
@MathieuGuindon here's a sample of what Wayne can extract: everythingaccess.com/mdeconversion_example.htm
 
holy crap
 
8:09 PM
That's apparently because of "compiler junk" that gets embedded. Hence his other product: everythingaccess.com/mdeprotector_example.htm
 
IOW, the tooling already exists and we have no business there
also VBA code is insecure, full stop
 
hm. how is that different from .NET assembly, though?
 
CIL?
 
We can decompile a .NET assembly more easily than decompile a p-code removed VBA project.
(assuming no obfuscator was used)
 
it's not
 
8:14 PM
so the argument that VBA code is insecure doesn't hold weight?
it's more like, they didn't provide the tooling for securing it for all types of VBA projects.
 
it's as insecure as any other code? the thing is that VS doesn't give you a "password-protect your project" illusion of security
 
oh yes, password protect is a big joke
and should have never existed.
hm. does VB6 have that?
 
I don't think so
 
but beyond that, it's just as insecure as a .NET assembly, the difference that it'll be harder to find a decompiler for VBA compared to one for decompiler. IIRC, there is only one that ThunderFrame mentioned whereas there are more than few choices for .NET assemblies.
If it's really that sensitive, it should be never on an end user's computer to start with.
 
^
if you don't want to leak your code, don't leak your code.
 
8:19 PM
Alternatively, you can hire an intern to write the code for you. Nobody'll ever be able to make heads or tails of it.
2
It'll have so many security flaws, an attacker won't know where to start :P
 
Great, Hosch! But will it actually work?!? :o
 
@this As long as you don't look at it sideways.
 
Really, from an actual security standpoint it is rather irrelevant whether you can look at the code.
It might be from a business standpoint though.
 
@M.Doerner Very irrelevant, although it can sometimes help find flaws.
On the other hand, it might obscure flaws because you look too much at the code and don't hit it enough in different ways.
 
I know, but you can decompile next to everything to find the commonly problematic portions of code. It just takes more effort.
^Yep, that is why widely used OSS software is considered rather secure.
There are so many poeple that already tried to break it.
 
8:28 PM
Well, OpenSSL did have a bug that nobody noticed for months....
 
True
 
Hopefully that was just a anomaly -- people were genuinely shocked by the fact that the bug existed for so long
 
At least someone found it in the code and notified the maintainers.
 
almost a year?
yes
 
Most low level software has stupid bugs like that.
That is why the OSS usually protects you against quite a large variaty of common threats.
Btw, regarding the rewriter and the busy state, I think this will get rather annoying to work with, if we cannot just hand out the rewriter itself and simply suspend while it is held by somone else.
I would know a way to achieve that, but that would be quite a hack.
 
8:33 PM
@M.Doerner OTOH, *nix systems have been having the most bugs reported per year by security researchers--because all the attackers focused on Windows for so long, it was effectually open-sourcing finding attacks.
 
OK, alright. I just wanted to keep the implementation simple as possible. If we encumber the contributor with "should do"s, it becomes annoying and bug-prone as well.
 
To be honest, I did not really understand your suggestion. Where would that delegate go?
 
let me find an example first
 
OK
@Hosch250 That is the point, You want people reporting the bugs to find them so that you can patch them before other poeple exploit them.
 
Right. But just because the code is OSS doesn't mean it is more secure than closed source software.
 
8:42 PM
so let's use this as an example: github.com/rubberduck-vba/Rubberduck/blob/next/…
what I envisioned would be something similar to this....
        private void PromoteVariable(IModuleRewriter rewriter, Declaration target)
        {
            if (new[] { DeclarationType.ClassModule, DeclarationType.ProceduralModule }.Contains(target.ParentDeclaration.DeclarationType))
            {
                _messageBox.NotifyWarn(RubberduckUI.PromoteVariable_InvalidSelection, RubberduckUI.IntroduceParameter_Caption);
                return;
            }

            var oldSelection = _vbe.GetActiveSelection();

            rewriter.Rewrite(() =>
basically, whenever we use any methods on the Rewriter, it has to be enclosed in Rewrite so that we abstract the suspension logic away from the refactoring/quick fixes
However, I realized that this is not easy to use if we have multiple rewriters as is the case in the MoveCloserToUsage refactoring.
This is also assuming that we must require that the suspension lock be held when we specify tokens to remove/add/whatever else. I don't know if that is a valid assumption.
 
9:05 PM
Now, I get the idea. The TokenSourceparameter was throwing me off.
I think it might be more intuitive though to pass an Action<IModuleRewriter>.
Moreover, the first thing done inside the suspension should always be to check whether the rewriter is still the current one.
ANyway, I think this can wait for a later PR.
 
that makes sense yeah - but how do we ensure that all rewriter's methods stay encapsulated inside the action?
Yes I agree that is best done in later PR. I have no plans to do this right now; I just want to finish the busy PR so I can finish the refactoring PR.
and then hopefully get around to the EM. (ha, ha, ha)
 
@this Going to tell them your sense of humor is leaking?
 
hmm maybe I should tell them that it's radioactive and cancer-forming. Maybe they'll give it back in a hurry?
 
9:35 PM
> # [Codecov](https://codecov.io/gh/rubberduck-vba/Rubberduck/pull/4098?src=pr&el=h1) Report
> Merging [#4098](https://codecov.io/gh/rubberduck-vba/Rubberduck/pull/4098?src=pr&el=desc) into [next](https://codecov.io/gh/rubberduck-vba/Rubberduck/commit/c5bb40f9981a7e759da7009d9a6d11a73aa9099b?src=pr&el=desc) will **increase** coverage by `<.01%`.
> The diff coverage is `22.58%`.


```diff
@@ Coverage Diff @@
## next #4098 +/- ##
=======================
> # [Codecov](https://codecov.io/gh/rubberduck-vba/Rubberduck/pull/4098?src=pr&el=h1) Report
> Merging [#4098](https://codecov.io/gh/rubberduck-vba/Rubberduck/pull/4098?src=pr&el=desc) into [next](https://codecov.io/gh/rubberduck-vba/Rubberduck/commit/c5bb40f9981a7e759da7009d9a6d11a73aa9099b?src=pr&el=desc) will **increase** coverage by `<.01%`.
> The diff coverage is `22.58%`.


```diff
@@ Coverage Diff @@
## next #4098 +/- ##
=======================
 
9:57 PM
[rubberduck-vba/Rubberduck] build for commit a6cdf6b2 on unknown branch: AppVeyor build succeeded
> # [Codecov](https://codecov.io/gh/rubberduck-vba/Rubberduck/pull/4098?src=pr&el=h1) Report
> Merging [#4098](https://codecov.io/gh/rubberduck-vba/Rubberduck/pull/4098?src=pr&el=desc) into [next](https://codecov.io/gh/rubberduck-vba/Rubberduck/commit/c5bb40f9981a7e759da7009d9a6d11a73aa9099b?src=pr&el=desc) will **increase** coverage by `<.01%`.
> The diff coverage is `22.58%`.


```diff
@@ Coverage Diff @@
## next #4098 +/- ##
=======================
[rubberduck-vba/Rubberduck] build for commit a6cdf6b2 on unknown branch: 52.63% (target 0%)
 
10:15 PM
> Valid shortcut keys are:

^[A-Z]
{F[1-12]}
^{F[1-12]}
+{F[1-12]}
+^{F[1-12]}
^{INSERT}
+{INSERT}
{DEL}
+{DEL}
%{BKSP}
 
I now see why nobody likes writing documentation.
Writing good documentation is hard.
 
there is that, but I also think the real killer is the maintenance.
 
Thankfully I don't have to worry about that.
I'm just trying to write baby step examples on how to use VBA for Excel.
 
@M.Doerner can you clarify the #3 and #5 in the busy PR? They seem to be say to do the exact opposite? #3 says to add a lock (which we already have a write lock) while #5 says to remove it?
 
I mean a separate ordinary lock on a separate lock object.
Not the same lock the actual suspension uses.
Its use is make sure that the suspension marker cannot change while in the if block.
 
10:26 PM
> # [Codecov](https://codecov.io/gh/rubberduck-vba/Rubberduck/pull/4098?src=pr&el=h1) Report
> Merging [#4098](https://codecov.io/gh/rubberduck-vba/Rubberduck/pull/4098?src=pr&el=desc) into [next](https://codecov.io/gh/rubberduck-vba/Rubberduck/commit/38be73730ae7a05dcca540a83c1c029fc6505fb0?src=pr&el=desc) will **decrease** coverage by `0.02%`.
> The diff coverage is `16%`.


```diff
@@ Coverage Diff @@
## next #4098 +/- ##
==========================
 
You do not want to still be in that block when the TryPop happens.
 
and just so I know I'm clear when you speak of "suspension marker", we mean _supsenionIteration, right?
 
Yes
 
good
 
[rubberduck-vba/Rubberduck] build for commit 49b04cfa on unknown branch: AppVeyor build succeeded
> # [Codecov](https://codecov.io/gh/rubberduck-vba/Rubberduck/pull/4098?src=pr&el=h1) Report
> Merging [#4098](https://codecov.io/gh/rubberduck-vba/Rubberduck/pull/4098?src=pr&el=desc) into [next](https://codecov.io/gh/rubberduck-vba/Rubberduck/commit/38be73730ae7a05dcca540a83c1c029fc6505fb0?src=pr&el=desc) will **decrease** coverage by `0.02%`.
> The diff coverage is `16%`.


```diff
@@ Coverage Diff @@
## next #4098 +/- ##
==========================
[rubberduck-vba/Rubberduck] build for commit 49b04cfa on unknown branch: 52.63% (target 0%)
 
10:43 PM
now that if we have an ordinary lock around the _suspensionIteration and _requestorStack, does it makes the use of InterLocked moot?
 
 
1 hour later…
11:48 PM
I think it does.
 
Moreover, since the access for adding to the stack is now excluive and the separated from poping the stack and clearing it because of the two locks, an ordinary stack would suffice, too.
 
FYI - I could not see a reason to separate the try/finally block.
 
@Duga @this @M.Doerner would appreciate your feedback when you get a chance. My grammar-fu is... limited.
 
11:52 PM
I did move the code around so that both separate locks for setting the marker & popping the lock happen inside the try block
the logic for checking whether reparse is needed is still outside the write lock (and the 2 locks), since we use local variables to bring forward the results discovered from actions inside the new lock inside the write lock.
 
So they moved the modem downstairs... now I gotta make the wire subtly get into the garage without ruining the living room
 
could you not use a powerline adapter?
 
?
I mean the ethernet cable
 
these things
(that's UK version ofc, assume they have similar in canada)
sends ethernet frames over mains wiring
 
Hmm.. But then what do I do with my 50-foot wire? =)
 
11:59 PM
lol
pfft... i have 400m of cat6...
 
I know! Build another server! #HowToGetBeheadedByYourWife
2
 
(given to me by a buddy during a house move)
 
00:00 - 18:0018:00 - 00:00

« first day (1473 days earlier)      last day (1707 days later) »