« first day (821 days earlier)      last day (2359 days later) » 
00:00 - 08:0008:00 - 18:00

12:00 AM
RELOAD!
[retailcoder/Rubberduck] 11 commits. 28836 additions. 18583 deletions.
[rubberduck-vba/Rubberduck] 6 commits. 2 opened issues. 10 issue comments. 24 additions. 36 deletions.
 
12:53 AM
@Jelly dayum. out of curiosity, does Excel crash as well? I think this might have something to do with an exception thrown while attempting to load the config file... although the PR I merged earlier today did fix part of that problem.. ugh stabilizing 2.0 is eating my brains.
Or was the crash at startup?
 
1:11 AM
@Mat'sMug The Crash is not caused by the RD. I didn't install it.
 
oh. well phew! wipes beading sweat
FWIW when @ThunderFrame said "wildly different", IMO that's an understatement: RD v0.x was pretty much completely rewritten since =)
 
@ThunderFrame the CAD industry is moving into the cloud. OnShape for instance is rivaling the industry giants. AutoCAD has its cloud solution called Fusion360 and SolidWorks has been experimenting with something similar. I think the transition would be gradual but some in the future, people will be forced to say bye bye VBA.
 
I know the founders of Aconex - Are you using that?
Everything will say bye-bye to VBA in the future, but VBA keeps waving back.
 
Not trying to start a negative vibe here but that's what direction I see things going at.
LOL
Aconex. I have no idea what that is.
Everyone will hop in the JS/Python wagon. That's new VBA.
 
Yeah, cloud-based tools like Anaplan are a threat to things like Excel, but there's just too much legacy Excel-based work to completely move away from it
 
1:18 AM
Since I'm here. There's a burning question I wanted to ask.
 
I know of some investment banks that still use Excel 4 Macros on user PCs
 
Web-server sided automation with Excel is not recommended. I read somewhere in MSDN, MS doesn't recommend.
Has anyone developed an Web app that uses Excel through interop?
 
gives you an idea of how people are tied to the legacy models
 
@ThunderFrame: Yes. As I said, the transition in none-IT centered industry will be gradually.
I knew someone who works for Bank. Makes a shit ton loads of money and is working with VB6.
 
agreed, and that CAD-widget production code will be running for some time yet
 
1:21 AM
That's from where I making $$$.
@ThunderFrame: have you tried installing Excel on VM (Windows Azure) as part of a website?
 
@Comintern reminds me of one of my favorite quotes from the Economist... Went something like....
> McKinsey & Company, a management consultancy held in high regard by those that work there....
@Jelly - No I haven't, but I have tried VBA under Excel 2016 on a Mac VM. It's unusable.
 
Hm.
That's not good.
 
@Comintern So, does that callback solve the fallback unit testing approach? Can we build unit tests in class modules?
Rubberduck needs a callback fallback...
 
Yea.
The old boys want it.
But the new guys are flying up the cloud.
 
@ThunderFrame Maybe, but it relies on the VBA code sending the function pointers. I also haven't figured out how to get the interface pointer for a class, but it works just fine in module code.
I pulled out my old Curland book though...
 
1:30 AM
haha RD site uses the default ASP.NET MVC template project
nice one...
 
lol I suck at web
 
somebody was in a hurry to put it live?
 
kinda
 
@Mat'sMug Nobody sucks.
We all learn.
Most of the people that will using rubberduck won't know that @Mat'sMug
 
my 1-year subscription for the old crappy WebSite Builder thing was going to expire, so I decided to get some hosting instead, and make a real site, in .net
 
1:32 AM
That'll be our little dirty secret
 
lol
 
lol
 
I started programming with VBA
 
me too.
 
No, some people legitimately suck at some things. I have a laundry list of stuff I suck at.
 
1:32 AM
@Comintern well, we are able to place the cursor in a procedure and execute the "Play" CommandBarButton. That was a problem because, IIRC, it did run the code, but Rubberduck didn't wait for it to be finished. If we executed some code that passed a pointer to Rubberduck, then RD could use that pointer to execute the real test?
 
I moved to VB.NEt to develop VSTA/O addins
but then realize C# was more like (simply because it was c-ish)
All the cool kids were using it. LOL
 
because I was working in an office, not in IT. That's what VBA has that everything else doesn't: a lot of the devs aren't programmers, they're office workers automating their job (and others' too haha)
 
I swear to God. That's exactly what it was like when I started.
 
@ThunderFrame Yeah, that would work. It seems like it would only need to be called once too. You could make the callback function just execute CallByName.
 
that's why VBA can't go
 
1:34 AM
They called me "Macro" at the office
 
With passed parameters from RD if I can figure out what it needs pointers to.
 
@Comintern wait what?
does that mean what I think it means?
 
At first I was insulted but then realized they meant as a cool thing
 
@Jelly the irony being that you were down and dirty in the Micro.
 
Then I went macro. lol
 
1:36 AM
@Mat'sMug Yeah, it looks like all you need to do is get a function pointer into managed code.
 
all you need to do, he says
 
RD would also need to be able to refresh the function pointer if the module was recompiled though.
 
just don't cache it then
fire-and-forget
use once and discard
 
but the parser would know if the module was recompiled?
 
He likes to 'cache' things?
 
1:37 AM
Well, the parser could tell if the typelib signature has changed.
 
cache-invalidation is all you need to do
 
hmm wait yeah there's a point here: the parser doesn't know when it's out-of-sync until it reparses ...because we don't have a VBIDE event telling us the content of the codepane is changing
 
If the class interface changed at all, that appears to be the only thing that invalidates the function pointer. The VBE would just recompile on demand when the callback function was called.
Should is probably more accurate. I keep forgetting that there is no "would" when it comes to the VBE.
 
that has to be how 2.1 runs unit tests
 
hmm, the only thing I can think of that might indicate if the code needs compiling is the state of the "Compile Project" CommandBarButton
 
1:40 AM
supported hosts: well all of 'em.
yep. if it's disabled your code is compiled - that's my clue as well
 
and if it's enabled, then your code changed
 
exactly
oh
oh god
 
@Comintern the code keeps crashing solidworks once in a while
 
only problem is, I've seen projects that don't compile because broken legacy code.
 
what do you think the problem is?
 
1:42 AM
@Jelly That has a ring of familiarity...
 
@Comintern lol
 
is it because the sub goes out scope?
 
maybe that's just a pre-requisite - Rubberduck supports all VBA, as long as you use Option Explicit AND your code compiles
 
our parser always assumed the code was compilable
 
@Comintern did it crash excel for you?
 
1:44 AM
It might be. I know less than nothing about Solidworks. Anything I tell you about Solidworks will likely make you dumber.
Nope, it was solid as a rock in Excel.
 
try
debug.print
for 1 to 1000
 
I tested with this a couple times already.
 
I'm trying this for time consuming methods
 
Public Sub Callback()
    Dim i As Long
    For i = 1 To 3000
        Debug.Print "Set by Test.dll"
    Next
End Sub
 
Weird.
 
1:45 AM
Let me try a Sleep API call.
 
grabs popcorn
 
hmm, how does the VBE handle VBE CommandBarButton events that are wired to VBA event handlers? That might be a clue as to how it handles TypeLib changes...
 
Public Sub Callback()
    Sleep 1000
    Debug.Print "Still here"
End Sub
Output:
 
goddamn it
 
...wait...for...it...
Still here
 
1:47 AM
is the call asynchronous?
 
Sleep 10000 is the same result.
Let me try adding a delay on the managed side.
 
661 and it crashed
 
Actually a better test would be to spawn a new thread in the dll, have that sleep, and then execute the callback.
 
<EXCEPTION> "Access Violation at 74e5bfc3 (virtual address 00000000), attempt to write to memory"
<RESOURCE_WARNING>CMD:GDIHandles ATTR:used=738 ATTR:load=7.38 ATTR:free=9262 CMD:CommitChargeMB ATTR:used=5124 ATTR:load=72.52 ATTR:free=1941</RESOURCE_WARNING>
<AD5> auAm_c::GetEnableFileMenu;auAm_c::GetEnableFileMenu;auAm_c::OnIdleNotify;auAm_c::iFireEventV;auAm_c::GetEnableFileMenu;auAm_c::GetEnableFileMenu;auAm_c::GetEnableFileMenu;auAm_c::OnIdleNotify;auAm_c::iFireEventV;
<RAWSTACK> MSVCR100:74E5BFC3:0003BFC3,VBE7:D6A91F86:000B1F86,VBE7:D6A91B23:000B1B23,VBE7:D6A91DD6:000B1DD6,VBE7:D6A9245
Try it sleep for 10 seconds
alright.
 
1:57 AM
Fully asych in Excel.
C# code:
        public void PerformActionAsync(long pObj, long AddressOfSubroutine)
        {
            long result = 0;
            //Call one.
            DispCallFunc(new IntPtr(pObj), new IntPtr(AddressOfSubroutine), CALLCONV.CC_STDCALL, VarEnum.VT_EMPTY, 0, IntPtr.Zero, IntPtr.Zero, out result);
            //Set up call two.
            var waitforit = new Waiter {FunctionPtr = AddressOfSubroutine};
            var test = new Thread(waitforit.PauseThenExecute);
            test.Start();
        }
VBA code:
Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

Public Sub Callback()
    Sleep 1000
    Debug.Print "Still here"
End Sub

Public Function GetFunctionAddress(test As LongPtr) As LongPtr
    GetFunctionAddress = test
End Function

Public Sub test()
    Dim COMLib As New Class1
    COMLib.PerformActionAsync 0, GetFunctionAddress(AddressOf Callback)
End Sub
Output after 1 second: "Still here". Output after 2 seconds: "Still here".
It's cool to watch in the VBE too. It switches to the wait cursor out of no-where for the second call.
 
i simply added
thread sleep
for 10 seconds
in the method
and sw crashed as soon as i hit compile
<EXCEPTION> "Access Violation at 74e5bfe3 (virtual address 00000008), attempt to write to memory"
is from the crash report
it worked earlier????
 
It looks like SW is letting the module go out of scope. Does it have Application events?
 
here's how i'm doing in c#
public void PerformActionAsync(long pObj, long AddressOfSubroutine)
{


long result = 0;
Task.Factory.StartNew(
() => DispCallFunc(new IntPtr(pObj), new IntPtr(AddressOfSubroutine), CALLCONV.CC_STDCALL, VarEnum.VT_EMPTY, 0, IntPtr.Zero, IntPtr.Zero, out result)
);


}
application events????
 
Maybe an issue surrounding the lamba? Let me try that.
 
yup
give it a try
i'll buy u a beer if it works
 
2:05 AM
Wait a second. How does an out variable work in a lambda expression?
 
bring the result inside the lamda?
 
@Comintern I don't think you need the GetFunctionAddress function - I only posted that because I thought you wanted to inspect the value from the VBA side. You should be able to just use: COMLib.PerformActionAsync 0, AddressOf Callback
 
I have no clue. It refers to the local variable, but it goes out of scope. I feel an SO question about that coming on...
Yep. Access violation here too. It's the out variable through the closure I think.
 
yeah better avoid lambdas with COM interop. we removed all LINQ code from the COM references collector code
the C# compiler does quite a lot of work with lambdas
 
It works if you make long result a class member instead of a local.
I think that's entirely on the C# side.
 
2:13 AM
let me try
 
I'll bet the reference to the out variable is getting garbage collected in the process of the call.
 
when it goes out of the scope of the lambda, the gc tries to claim it?
 
sometimes, I bet
 
LOL
Here's something that will make u fall off your chair
 
Yeah, although come to think of it, it's a primative. You're probably putting the stack address in the out parameter and it goes out of scope before the lambda is done with it.
 
2:17 AM
Add a debug.print("I just caused it to crash") after the comlib.sostuffanyc
and try to compile it
it crashed my solidworks
 
@ThunderFrame I left that in because I was still playing around with trying to get it to execute on a class instance.
@Jelly That's an easy one - the COM server is busy.
 
aw man
wish vba had like await keyword
is there for a fix that mr intern?
@Comintern
 
Checking on something. I wonder if the dll is running MTA threaded.
The interop assembly is supposed to handle marshalling into an OLE STA environment, but Microsoft fudged on the COM rules a bit in the implementation.
 
Try decorating it with the [STAThread] attribute.
 
2:28 AM
itching to change that radio button
 
Ooooooooo, tasty.
Don't even get me near it with a debugger.
 
VBA SDK
is that a real thing?
 
Yeah, it's how all these host applications get VBA integrated into them.
I wonder why it's not compatible with Office 2K+.
 
@Comintern added the attribute to the method now building and testing
STAThread is static thread?
 
2:33 AM
@Comintern I'm using the 6.4 SDK - I wonder if pre-2000 was an earlier version of VBA?
 
i thought you were trying to shove the product of aconex (the company you interning at)
@Comintern
 
Actually, I wonder if it has to do with the debugger.
 
with that link lol
 
Contrary to popular belief, I am not an intern in the ways of COM. It's an old MUD handle.
 
it works for three times
and it crashed
i use debug print from 1 to 5
and i got this
1 2 3 4 5 test 1 test 2 3 4 5 1 2 3 4 5 test
 
2:39 AM
I suspect timing issues. .NET COM interop violates some of the STA contract assumptions.
@Jelly That means it's working.
 
can you explain to me what the sta attribute does
in a nutshell
 
@Jelly no, not trying to sell anything. I know the guys that run it, but I know next to nothing about the product, or the construction industry.
 
It basically means that only one thread controls access to the objects created inside its apartment.
 
@ThunderFrame it was a joke
i see stuff that's not the way to do though :D
 
This is the gist from the link above:
"Rather than using thread synchronization objects (mutexes, semaphores, and so forth) to control access to an object by several threads, the marshaling process for STAs translates the call into a WM_USER message and posts the result to a hidden top-level window associated with the apartment when it was created. Calls from several different threads are converted and sent to wait in the apartment's message queue until they are retrieved, dispatched, and executed on the apartment's thread. "
"This process controls access to an apartment's objects by forcing incoming calls to pass through a sort of turnstile, thereby rendering the object's interface implementations thread-safe."
 
2:43 AM
@Comintern it's working yes but then after seconds when i try to edit the code vba crashes
something's working behind the scene after the compiler stops
 
Is the managed thread still active?
No editing when you're getting external calls!
 
yes
i'm only editing after the debug.print for loops stops
there has to be a way to kill the thread after it ends
 
Believe you need to send it a cancellation token. That's an RD issue too.
 
@jelly ha, serves me right trying to read this while doing 6 other things.
 
Old school threads would be more stable.
 
2:48 AM
should be use a thread instead of a task @Comintern
?
 
What happens when you edit is that you invalidate the compiled binary. The incoming call forces a recompile, but it's doing that at the same time it's supposed to be running code. It's like running a function as you write it with VBE interop.
@Jelly Yeah. That's what I meant by old school threading.
I'm not sure how C#6 asych-await code would work with that, but that might be another option.
 
I had another idea about tracking the pointers. If there was a predeclared class, and RD had a pointer to it, if the VBA project was reset, then maybe we could tell that the pointer was invalid?
IIRC, the pointers for the Workbook component are constant.
 
Yeah, the document pointers are owned by the host.
 
Hmm, we could use those instead of hijacking the help?
 
Only in hosts that have a document class, and locating it would be host specific I believe.
In IBM Reflection for example, the "document" is basically just a global Session object. But it doesn't have a class module.
 
2:57 AM
Same in PowerPoint, unless a slide has an ActiveX control on it.
And Access without any forms or reports
 
trying this
[DispId(1)]
[STAThread]
public void PerformActionAsync(long pObj, long AddressOfSubroutine)
{

Thread myNewThread = new Thread(() => DispCallFunc(new IntPtr(pObj), new IntPtr(AddressOfSubroutine), CALLCONV.CC_STDCALL, VarEnum.VT_EMPTY, 0, IntPtr.Zero, IntPtr.Zero, out result));
myNewThread.Start();

}
all good
 
:thumbsup:
 
Complete explosion.
I want my task back.
Give it a try @Comintern
 
Don't use a lambda. Look up to my Thread example - wrap it in a child class instead.
 
Half-explosions are over-rated
 
3:06 AM
But I love lambdas!
How do you go about doing it like you thread example?
 
                          ____/ (  (    )   )  \___
                         /( (  (  )   _    ))  )   )\
                       ((     (   )(    )  )   (   )  )
                     ((/  ( _(   )   (   _) ) (  () )  )
                    ( (  ( (_)   ((    (   )  .((_ ) .  )_
                   ( (  )    (      (  )    )   ) . ) (   )
                  (  (   (  (   ) (  _  ( _) ).  ) . ) ) ( )
                  ( (  (   ) (  )   (  ))     ) _)(   )  )  )
                 ( (  ( \ ) (    (_  ( ) ( )  )   ) )  )) ( )
 
I'm on the verge of having a brain fart
 
1 hour ago, by Comintern
        public void PerformActionAsync(long pObj, long AddressOfSubroutine)
        {
            long result = 0;
            //Call one.
            DispCallFunc(new IntPtr(pObj), new IntPtr(AddressOfSubroutine), CALLCONV.CC_STDCALL, VarEnum.VT_EMPTY, 0, IntPtr.Zero, IntPtr.Zero, out result);
            //Set up call two.
            var waitforit = new Waiter {FunctionPtr = AddressOfSubroutine};
            var test = new Thread(waitforit.PauseThenExecute);
            test.Start();
        }
 
Parameterized thread?
 
No, it just calls a concrete method of the class instead of a lambda.
 
3:10 AM
that doesn't wrap the dispcallfunc inside the thread?
 
Yes, but that's only a dll call.
 
not getting it
can you show me how to do it?
 
It puts the object that will be calling dispcallfunc inside the thread, passes the parameter to the constructor, then it executes the method on a new thread.
 
whats the namespace for waiter?
 
It's a child class of Class1. This is probably a horrible example, but this will start a thread that "polls" the callback function every second indefinitely:
        [DllImport("oleaut32.dll")]
        public static extern long DispCallFunc(IntPtr pvInstance, IntPtr oVft, CALLCONV cc, VarEnum vtReturn, uint cActuals, IntPtr prgvt, IntPtr prgpvarg, out long pvargResult);
        long result = 0;

        [STAThread]
        public void PerformActionAsync(long pObj, long AddressOfSubroutine)
        {
            var waitforit = new Waiter { FunctionPtr = AddressOfSubroutine };
            var test = new Thread(waitforit.PollVBA);
            test.Start();
I'm curious about the lambda though. I wonder if this works: (x) => DispCallFunc(new IntPtr(pObj), new IntPtr(AddressOfSubroutine), CALLCONV.CC_STDCALL, VarEnum.VT_EMPTY, 0, IntPtr.Zero, IntPtr.Zero, out x)
 
3:20 AM
crash
I'm promoting you to C-level position my friend
"Senior VP of Crash Procurement"
@Comintern
hows that for a title?
 
Weird. In Excel my output is this:
Still here
Still here
Still here
Still here
Still here
Still here
Still here
Still here
Still here
Still here
Still here
Still here
Still here
Still here
Still here
Still here
Still here
Still here
Still here
Still here
Still here
Still here
Still here
Still here
Still here
Still here
Still here
Still here
Still here
Still here
Still here
Still here
Still here
Still here
Still here
Still here
Still here
Still here
Still here
Still here
Still here
Still here
Still here
Still here
Still here
Still here
The only way I've crashed Excel is by hitting the stop macro button on the toolbar during the callback.
 
Would you like to TeamViewer me?
I don't mind that.
 
Although, interestingly enough... If you're in break mode when the callback executes, it gets stuck in debug mode.
I'm on Linux. Not sure if TV will work in my VM...
 
OK
Thanks Linux (Obama)
 
Gimme a sec. I'll try it. I'm curious now.
 
3:25 AM
Take two seconds.
 
OK, what's your ID and pass.
 
You're blazing fast.
Wait a sec
I need to close all the porn tabs first.
2
 
LOL
 
lol
You're gonna be in holy land.
So behave.
741 023 360
pass
9989
 
Well I'll be damned.
Slow as hell though.
 
3:29 AM
you're good to go
 
Remote control is busted.
Oh wait. Just hella latency.
 
Tunisia?
 
Seriously?
Can't find entry point to Sleep?
LOL. They'll have fun with that error report.
 
lol yea jelly sai
d
you opened the mini with vs for web?
 
Yeah, but that doesn't matter as much as it being the Express version. I think they lock out some of the debugging tools in the non-professional version IIR.
 
3:42 AM
is the teamvs over?
good
all yours mister
you got it bo
 
4:39 AM
@ThunderFrame you won't believe the things @Comintern told me in teamviwer chat
unbelievable
 
That's what the judge said too.
 
LOL
btw Tunisia is the country that stole .TN domains off the state of Tennessee. They're pisssed at us @ThunderFrame
that explains the traffic im getting from jobseekers in Tennessee looking for job at my domain monster.tn
good night all!
 
Looks like you live in Tunisia but keep Tennessee time?
 
 
2 hours later…
6:43 AM
[retailcoder/Rubberduck] retailcoder pushed commit 0fe484ec to next: fixes #2210, implemented inspection setting to determine whether or not to run inspections automatically on successful parse.
[retailcoder/Rubberduck] web-flow pushed commit b035f686 to next: Update Rubberduck.csproj
 
> Closes #2210 and #2194 - adds a "run inspections automatically on successful parse" inspection setting (enabled by default), and no longer accounts for parser state's IsDirty property to determine if inspections can be executed.
> So, next release introduces a new inspection setting:

![there's a new inspection setting in town!](https://cloud.githubusercontent.com/assets/5751684/18229475/b570c166-7248-11e6-93e7-1d33e51518b5.png)
[rubberduck-vba/Rubberduck] build for commit b035f686 on unknown branch: AppVeyor build succeeded
Merge pull request #155 from rubberduck-vba/next

sync with main repo
[rubberduck-vba/Rubberduck] retailcoder pushed commit 5415c5a3 to next: added + icon to untracked files' "include" button in source control panel.
Merge pull request #156 from rubberduck-vba/next

Sync with main repo
[rubberduck-vba/Rubberduck] retailcoder pushed commit 0fe484ec to next: fixes #2210, implemented inspection setting to determine whether or not to run inspections automatically on successful parse.
[rubberduck-vba/Rubberduck] web-flow pushed commit b035f686 to next: Update Rubberduck.csproj
Merge pull request #2214 from retailcoder/next

Code Inspection fixes
> Fixed with PR #2214
[rubberduck-vba/Rubberduck] build for commit 6aa9466f on next: AppVeyor build succeeded
 
7:03 AM
@duga keep on spammin'
but seriously, it's 3am
 
IKR
just testing another bugfix and then I'm out :)
 
7:53 AM
[retailcoder/Rubberduck] retailcoder pushed commit 86feaa94 to next: ProcedureCanBeWrittenAsFunction inspection now honors @Ignore annotations
[retailcoder/Rubberduck] retailcoder pushed commit 3c023cf6 to next: fixes #2179 - makes DoNotShow severity also apply to ParseTree inspections.
> fixes #2179 and now honors @Ignore ProcedureCanBeWrittenAsFunction annotation.
Merge pull request #2214 from retailcoder/next

Code Inspection fixes
[retailcoder/Rubberduck] web-flow pushed commit 9e1b044f to next: Merge branch 'next' into next
 
I know, I know, ...it's a whole hour later
 
[rubberduck-vba/Rubberduck] build for commit 3c023cf6 on unknown branch: AppVeyor build failed
BUILD FAILURE!
 
00:00 - 08:0008:00 - 18:00

« first day (821 days earlier)      last day (2359 days later) »