« first day (2057 days earlier)      last day (1123 days later) » 

12:00 AM
@Duga ftfy
 
RELOAD!
 
@MathieuGuindon that's not accurate - build didn't fail.
 
[Minesweeper] Games Played: 87, Bombs Used: 60, Moves Performed: 12089, New Users: 12
RELOAD!
[rubberduck-vba/Rubberduck] 8 issue comments
 
@this =)
 
more like it!
 
12:07 AM
@this you know how i asked you what font/character MS used for the drop down arrow on the VBE combo box and you couldn't really answer?
 
I have to say, though, it's kind of funny to say "informational" and "failure" in same sentence.
 
i think there was a reason for that:
 g.FillPolygon(brush, new Point[3]
        {
          new Point(point.X - ComboBox.FlatComboAdapter.Offset2Pixels, point.Y - 1),
          new Point(point.X + ComboBox.FlatComboAdapter.Offset2Pixels + 1, point.Y - 1),
          new Point(point.X, point.Y + ComboBox.FlatComboAdapter.Offset2Pixels)
        });
 
yeah, I made a random guess about MS San Serif.
?
where did you get that code from?
 
System.Windows.Forms in dotPeek
 
???
 
but.... VBIDE isn't .NET
 
what were you peeking on specifically?
you might have been peeking RD's stuff, not VBIDE's.
 
no this is the base System.Windows.Forms.dll
 
that possibly cannot be right
VBIDE pre-dated .NET by a good half decade or so
and has to be purely Win32
 
12:10 AM
how do they have certain UI elements looking like winforms?
 
Winforms is actually based on Win32
but mind, it's just .NET overlaid on top of Win32
 
VBIDE has zero .NET, unless you are running an add-in, like Rubberduck.
 
so where does MSForms fit in there?
even older than win32?
 
MSForms is basically a ActiveX layer on top of Win32
 
12:11 AM
@this I am of course!
 
Taht's why dotPeek is giving you results, then. It's telling you about the duck, not VBIDE.
 
im not looking at VBIDE at all
 
Then I'm confused. Why did you wnat to know what fonts Microsoft was using in VBIDE?
 
I just thought VBIDE used winforms so I was looking at the base winforms .dll in .Net
^
 
Nope, it doesn't
 
12:13 AM
got it
see i thought that because the "arrow" on those drop downs in VBIDE
looks like the same thing as the arrow in things that are 100% on .Net
 
nope that's Win32
or more precisely, the windows theme
 
and dotPeek cant help with that because its not .Net?
 
I mean, if you don't like the arrows, you can change the theme to Windows classic and get that plus/negative thingy they used to use in older Windows OSes.
 
no that looks awful lol
 
Yeah, it only can tell you about .NET stuff, but not unmanaged code.
 
But the point is that you can change theme, so that's why VBIDE can look same like .NET becuase they happen to be using the Windows theme for that particular control
 
see this is why i come here - i think i figured something out and then get to happily learn i was only halfway there :)
ohhhh
 
but that's also why VBIDE can still have old fugly icons still
 
so winforms control is drawing itself based on the theme
just like win32 contorl
 
yeah
actually it's win32
win32 is the lowest level
winforms is just a .NET veneer on top of win32
just like MSForms being an ActiveX veneer on top of win32
 
12:16 AM
win32 is like core OS?
 
it's the API
 
i know what API means now! (because of interfaces)
ok i think that makes sense
 
if you're feeling particularly adventuresome, you can even use VBA + bajillions Declares statement to create controls.
Just don't try to subclass in VBA, though.
 
Public Sub Declare Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)?
 
12:18 AM
the Public Sub part of that makes sense
well and the parameter too
 
ok, that is how you can step out of the VB sandbox and reach the bigger, wilder and dangerous world of Win32 API.
 
Declare Sleep Lib "kernel32" is uh
oh
so VBA can interact with Win32 API directly
 
basically you're saying "hey, there's a function in "kernel32.dll" I wanna to use. It's called "Sleep". So lemme tell you what parameters it takes so that you can call it for me, mkay?"
well, yeah.
but remember, you've left the sandbox.
Win32 is not so forgiving if you don't do things right.
 
like things crash?
 
Public Sub Declare Sleep Lib "kernel32" (dwMilliseconds As Long) won't do what you think it should do.
 
@theVBE-it'srightforme actually that's one of better outcomes.
 
all you did was change ByVal to ByRef?
 
yeah.
 
@this irreversible registry damage!
 
well, that's worse, yeah but at least it'll make itself known.
 
12:22 AM
well thats nice
but also scaring me off lol
 
The worse outcome, IMO is when nothing happens but you've corrupted the memory or file already and you won't even know about it until later.
 
@this i dont need Win32 for that ;-)
actually i do now because of your advice i guess
still havent had that problem since i started never saying yes to reset dialog
anyways
why does ByVal to ByRef have a big impact there?
 
Ok, let's look at it.
the thing about C++ is they love dem aliases
DWORD isn't a type.
it's actually an alias.
then search for DWORD, what do you find?
 
12:37 AM
i sometimes feel that as a language C++ is actually a very twisted joke
 
:D
 
@this "A 32-bit unsigned integer"
 
but you need to at least know a bit about it because that's what win32 is basically
Very good.
Now look up LPDWORD on the same page.
 
well thankfully my first programming class was half C++ and i suffered through it trying to make a mod add in for a game
which is actually what got me to DL visual studio in the first place
it say it is a pointer to DWORD
 
ok very good.
 
12:41 AM
gold star for reading ability :)
 
let's try this VBA code.
 
now im getting concerned
 
Dim l As Long

l = 3
Debug.Print VarPtr(l)
 
let me get vbe up
 
VarPtr will tell you the address of the l variable. What does it give you?
 
12:43 AM
192611840
 
why not 3?
what is 192611840, exactly?
 
i believe from what i've read that it is where the value of l is stored in memory rather than the value of l itself
 
Exactly!
so when you send a variable byref, are you copying its value (3) or its address (192611840) ?
 
value :3
so that is basically the difference between byref and byval
 
nope. That'd be if it was ByVal
ByRef means you pass the memory address, in which case is 192611840.
 
12:45 AM
@this oh lol that is why i used the ":3" emoji
 
My sense of humor is defective. ;-)
 
you made the right answer really clear so i was just having some fun
 
anyway - so pop quiz!
 
@theVBE-it'srightforme System.Windows.Forms is WinForms, the .NET successor to MSForms
 
Sleep expects a DWORD for its dwMilliseconds parameters. What is the value of the dwMilliseconds when you pass the l by reference to it?
 
12:47 AM
@this well if that address that debug.print gave me is an integer or implicitly converted to one...
 
it is an integer.
 
so memory addresses are stored as integers
well then yeah
 
yeah. So you end up sleeping for 192611840 milliseconds.
That's like 53 hours of sleeping.
See you in a few days!
 
programming is fun!
 
now, that's only a harmless thing that could go wrong when you don't get the declare right.
but it could be much more worse
so you better dot your i's and cross your t's because Win32 ain't doing it for you!
 
12:50 AM
this is why when i tried to learn programming with C++ i gave up
 
what? I'm sleeping for 192611840 seconds. Exactly just what you told me!
So yes, getting ByRef or ByVal wrong in the Declare can be ... fun.
 
@MathieuGuindon as I recall you told me it was better than MSForms in like every way
 
especailly because in C++ world, the default is to pass variables by value, but in VBA world, it's the opposite
@theVBE-it'srightforme that's mainly by the virtue of .NET
e.g. it handles details for you that you don't have to deal with boneheaded mistakes like forgetting to deallocate memory or accessing a dead pointer or whatever.
 
@this you have sufficiently scared me off of Declares lol
 
LOL. However, there are several good uses for Declares. I just wouldn't want to try and create controls & subclass it in VBA...
#FunFact: Rubberduck does lot of unsafe things even in .NET; so we have to act like C++ programmers sometimes.
 
12:55 AM
i love how the # symbol is essentially composed of ++
 
yeah it's supposed to be ++++
 
C++ now with double the +'s!
brb going into marketing
@this so that does reinforce the need to at least have a basic idea about C++
 
yep because you just can't get away from Win32 and the leaky abstractions.
You do know about the law of leaky abstraction, right?
 
@theVBE-it'srightforme and yet the same UI design patterns apply - "smart UI" and Model-View-Presenter. WinForms is just better because it's newer and has better layout capabilities, but nothing that gets anywhere close to WPF's (whatever @this might say about WPF ;-)
 
uh i believe I have seen that term used in (at least) one of the RD blog posts
 
but the law part no
 
^ this is a mandatory reading.
 
"2002"
basic principles always basic principles :)
 
^ an excellent supplement to that point.
Yep.
 
oh this is the dude that started SE
 
12:59 AM
eh, GoF OOP patterns book dates well earlier than that, and still relevant
 
@theVBE-it'srightforme and apparently wrote the VBA language specs
 
@MathieuGuindon TBH, I don't see myself quoting GoF as much as I do SOLID....
 
"We spend a lot of time on this site talking about exciting Big Picture Stuff like .NET versus Java"
that, however...
@MathieuGuindon he worked for MS?
 
yeah, back in early 90s
 
1:01 AM
@MathieuGuindon WPF is MVVM instead of MVP from what I read?
 
@theVBE-it'srightforme correct
 
@this oh yeah this is an excellent article
 
MVVM > MVP generally since you don't need to write the two-way binding by hand.
 
"And you can’t drive as fast when it’s raining, even though your car has windshield wipers and headlights and a roof and a heater, all of which protect you from caring about the fact that it’s raining (they abstract away the weather)"
 
@this yeah but a big chunk of my book is going to be about OOP design patterns (and when NOT to use them), so I have that one nearby =)
 
1:05 AM
such a perfect analogy for people who arent adept at programming
ok to change gears for a bit
 
@MathieuGuindon the one that was published or will be?
 
i tried to
make a dummy library in Visual Studio
got it to build successfully, got it registered with regasm, it shows up in VBE "Add References" list
 
@this will be, assuming I ever finish writing it
I keep reminding myself that the role of "draft 1" is to just exist
 
Cool! If it does, I'd love to see it!
 
@MathieuGuindon hardest thing to actually believe sometimes
i think because at some level you have the ideas in your head a lot more beautifully than you're getting them out and you dont want to be content with what a draft 1 is supposed to look like
@this seconded, if its anything like the RD posts
 
1:12 AM
idk, I just have so many things to say, and I have to be careful to remain coherent... my mind is already 5 sentences ahead whenever I start writing something
 
anyways to conclude what i was saying, basically object browser will show Public Module TestModule or Public Class TestClass but then wont show Public Function TestFunction that is a member of those
 
considers reducing alcohol intake
 
both alcohol and caffeine.
 
the ballmer peak is just as real with prose as it is with code :)
 
@theVBE-it'srightforme did you decorate the members?
 
1:14 AM
when i have that problem i sometimes just start outlining sentences
 
@theVBE-it'srightforme haha!
 
or even skip ahead if i get a really nice phrasing popping into mind for that sentence 5 ahead
 
@this i would assume not?
 
no attributes => crappy interop
 
1:15 AM
uh where would i start reading on that
@MathieuGuindon literal lol
 
that punchline
 
it's the old COM-visible API library that we removed from RD
but it has all the attributes you will want to have
 
im writing in VB not C# :(
or easy to translate those?
 
you still use the same attribute, different syntax
 
like, <ComVisible>, I think
 
i did com visible in the build settings :(
 
yeah, it's not that great
like you just found out
 
classic
im so unsurprised its almost surprising how unsurprised i am
all the MS reference for this is on C# not VB.Net
Parser : IParser, IDisposable
 
someone once claimed that it's possible to do all that without attributes but I didn't feel comfortable because it then just end up hiding the implementation details which will come back to bite you. So I'm in favor of manually specifying everything explicitly
 
1:20 AM
that is C# for Implements IParser and Implements IDisposable?
 
yeah, IDK how VB.NET does multiple implements.
 
VBA does with multiple lines!
 
:facepalm:
 
:3
actually you can use : to jam things together on one line right
i know that is not good programming practice of course
anyways it appears your attribute syntax was basically correct
 
Consider ditching VB.NET while it's still early =)
 
1:25 AM
C# syntax is too close to C++ :/
 
Because once you get into delegates and anonymous functions, things get pretty ugly, pretty damn fast in VB
 
C# handles those better?
 
That's putting it mildly
 
okay i will
try converting my dummy library to C# and see how it goes
as an exercise to write something simple with it
 
29
A: Does VB.NET have anonymous functions?

SamIt does in VB10: Dim food = New With { .ID = 1, .Name = "Carrot", .Type = ( Function(name As String) If String.IsNullOrEmpty(name) Then Return String.Empty Select Case name.ToLower() Case "apple", "tomato": Return "Fruit" ...

 
1:29 AM
it should be said that
anonymous functions are something i dont understand at all
so i should probably start with reading about those
they sound like they are probably pretty useful
 
for me the most important reason to do C# is that you find documentation in c# way more tahn you'll in VB.NET
 
once one understands what they are
 
and you don't have to do the painful translations.
contrary to what MS may say, VB.NET is really a second class citizen
 
@this "all the MS reference for this is on C# not VB.Net"
lul
so i wasnt imagining things
ok
 
learning .net involves so much unlearning VBA/VB6, doing it in a language that tries too hard to look like VBA/VB6 is messing with my brains - the context-switching is much easier when .net code is a completely different language
 
1:32 AM
^ same for me
 
isnt there less unlearning VBA for someone who was a nice responsible student and read all about OOP with VBA :)
 
@MathieuGuindon now I know why you're so smart - you have brains unlike the rest of us peons who only has one!
 
lol
@theVBE-it'srightforme and now my seekrit plan is uncovered!
 
@MathieuGuindon you said that OOP is OOP regardless of language too many times to keep it hidden :)
 
1:34 AM
@theVBE-it'srightforme not sure that matters, though. Look at declaring variables
Dim x As Long vs long x;
 
but its the same in VB.Net as VBA for that
@MathieuGuindon btw is that why you ported RD to C# instead of VB.Net when you realized it needed to leave VBA?
 
yeah but early into learning C#, just how painfully verbose VB is, hits you
@theVBE-it'srightforme I never bothered to learn all about VB.NET
 
verbosity helps people who are new to programming read what they are writing :)
@MathieuGuindon oh so you already knew C# at that point
anyways neither of you need to actually convince me
i was serious about trying the library in C# instead
 
I learned BASIC 2.0 on a Commodore 64 at age 12 or 13, then toyed with QBASIC a few years later, then with VB4, VB5, VB6.
 
i dont love the syntax but it definitely does suck less than C++
 
1:38 AM
Got a job involving Excel one day, toyed with VBA
 
Too bad you didn't learn VBA on C64
 
and i was capable enough of reading it in dotPeek
@MathieuGuindon it seems almost natural to get into VB.Net with that progression ;-)
anyways i think i need a bit of a break so im going to go abuse power weapons in mcc reach for a couple games and then try some C#
 
eventually I landed a job in the company's IT department and they made me learn C# and .NET - that was around 2009-2010. Then life happened (literally) and I got a VB6 gig for a while (that's when Code Review happened, ...and I reviewed a lot of C# before I decided to generate a ton of VBA content), and then the place I currently work for got to me and here I am, doing TSQL, VBA, C#, whatever needs to be done!
 
hopefully i can get it working :)
 
if VB.NET was basically VB7, maybe. But it wasn't. There's a reason why it was originally derided as "Visual Fred"
 
1:43 AM
haha
 
"not VB"
 
^
 
im missing something
 
i think the original petition and website is still up if you serach for it
when MSFT unveiled VB.NET there was a howl of protests from the VB fans
because it looked like VB but wasn't (there were lot of small differences) that made it quite unlike VB so they called it Visual Fred to emphasize that it had nothing to do with VB as they knew it.
 
1:46 AM
got it
now that it makes sense its extremely funny
"Fred" is a perfect dummy name
anyways
@MathieuGuindon wait is VB6 different than VBA?
actually nvm
 
not that much. VBA is a subset of VB6
 
i realized i knew the answer to that after i asked the question :(
because of reading RD posts of course
 
funny, it kind of occurs to me just now that VB.NET probably has as much difference from VB6/VBA as VB6/VBA does from original C64 BASIC.
 
ok ill be back in a bit, hopefully with a working C# library to report :)
 
 
1 hour later…
3:17 AM
lol suffering through the C++ i tried to use for the mod addin has made writing C# a lot easier to deal with than i thought it would
 
3:56 AM
okay i have it in c#, got it to build and register, got the [ComVisible(true)] attribute on both the class and the single member function, and still wont show anything but the class itself in VBA @this @MathieuGuindon if either of you are here
 
did you look at all the attributes?
there are several.
look at the Rubberduck API I linked you to to see all attributes.
 
right
uh
scrollingup
i closed it :(
 
note that you need attributes on the interface, on the class and on the members.
 
oh i need it on the namespace too?
 
(and if your class doesn't have interface, you need it, too)
don't think namespaces can have attributes.
just the class, the interface and members on the interface.
 
3:58 AM
using System.Windows.Forms;
using System.Runtime.InteropServices;

namespace TestLibrary

{   [ComVisible(true)]
    public class TestClass
    {
        [ComVisible(true)]
        public object[] TestFunction(int value)
let me look at the RD
 

« first day (2057 days earlier)      last day (1123 days later) »