« first day (781 days earlier)      last day (2399 days later) » 

12:01 AM
RELOAD!
[Hosch250/Rubberduck] 8 commits. 1031 additions. 14659 deletions.
[rubberduck-vba/Rubberduck] 5 opened issues. 14 issue comments.
[VSDiagnostics/VSDiagnostics] 3 commits. 2 closed issues. 348 additions. 10 deletions.
[Zomis/Monopoly] 1 commit. 13 additions. 14 deletions.
 
 
1 hour later…
1:04 AM
@Hosch250 other IoC containers have xml configuration, and seldom offer binding by simple naming convention.. so you end up constantly editing a hugeass xml config. Are you mixing up DI with Ninject?
 
Maybe.
 
Ninject has the best API, just not the best performance
 
I think there is some good in it, but I think it needs to be build into the actual language compiler to really be good at it...
It is just a horrible, horrible bloody mess otherwise.
On the other hand, it still would be.
 
No. We made it that way.
 
I have no idea, but I don't think this is the best it can get.
 
1:05 AM
Agreed. I'm just saying we're to blame, not Ninject
Okay, I'm to blame for most of it
 
Maybe.
 
And you still need to read Mark Seemann's book
 
I need to read Mark Seemann's book.
 
Yup, I'm going to read it after I finish Skeet's book.
 
It's in my personal top 3 best reads =)
 
1:08 AM
On the other hand, just because someone said something in a book, it doesn't mean it's right ;)
 
well the guy knows his shit anyway
 
Is there a character limit on Code Review answers?
 
I've seen some pretty big ones, so I'm guessing not a small enough one to really matter.
 
syntax for passing a vbNullString to a default member using bang notation:
Dim ClassWithDefaultMember As New Class1
Debug.Print ClassWithDefaultMember![]
 
Gah! My eyes!!!
 
1:22 AM
@ThunderFrame I thought that was shriek notation.
 
shriek/bang = US/UK?
@comintern how about:
Debug.Print ClassWithDefaultMember![(((((+-&^%$#@!]
 
Or lazybones notation
 
I've always used the term 'bang' (US). !!! is shriek notation.
 
I've only heard about Bash Bangs.
Those are usually written with #, IIRC.
 
@Comintern 60K-some IIRC
 
1:23 AM
I think you mean hash-bang = #!
 
Oh, that's it?
 
or a 'shebang
In computing, a shebang is the character sequence consisting of the characters number sign and exclamation mark (#!) at the beginning of a script. It is also called sha-bang, hashbang, pound-bang, or hash-pling. Under Unix-like operating systems, when a script with a shebang is run as a program, the program loader parses the rest of the script's initial line as an interpreter directive; the specified interpreter program is run instead, passing to it as an argument the path that was initially used when attempting to run the script. For example, if a script is named with the path path/to/script,...
 
Oh, then I have well over 50K left. I'll leave the rest for somebody else.
 
how does RD fare with Debug.Print ClassWithDefaultMember![(((((+-&^%$#@!]?
 
Does that make this a "Hebang"? ♂!
 
1:26 AM
where do I find the scissors glyph?
 
@ThunderFrame it should parse just fine
 
Don't you dare make it a Neuterbang... O!
 
@ThunderFrame Doesn't blink.
 
that article I posted makes the case that everything after the ! is effectively a string-literal (that might need to be enclosed in square brackets, if the literal contains special chars)
 
@Mat'sMug Do you have any idea how to get the Ninject stuff released?
That is pretty much one of the biggest bugs right now.
 
1:34 AM
Back into the Indenter mines... FunctionAlign is one of the remaining mud balls.
 
Disposing the kernel disposes all disposables. If something doesn't get disposed, the bug is in our code, not in Ninject
IIRC there's an explicit Release method on the kernel too, but I'm not sure
 
Yep.
Except, we can't have everything in transient scope, can we?
 
We don't have much in transient scope afaik
...or do we?
 
We have some.
 
If any disposable has that as a dependency, that would be a leak
 
1:37 AM
Has what as a dependency?
The default scope doesn't dispose of anything.
 
anything in transient scope
 
Transient scope does dispose of things.
 
The default scope is transient
 
Transient: "Lifetime is not managed by the Kernel (the Scope object is null) and will never be Disposed"
 
Oh, right.
Then almost everything is in transient scope.
 
1:40 AM
Are you sure the default is transient? Without checking I would have guessed request scope was the default.
 
@Comintern yep, completely sure.
Isn't request scope specific to mvc?
 
We need most things to have parent scope.
I don't know.
Or would it be call scope?
 
aye, InCallScope would be it
 
Ah, that it is. I'm not sure it would be limited to MVC apps though.
 
1:43 AM
indenter settings are in transient scope, but I don't think it matters
as is Func<IVBAPreprocessor>, wherever that's used
        Bind<IControlView>().To<ChangesView>().Named("changesView");
        Bind<IControlView>().To<BranchesView>().Named("branchesView");
        Bind<IControlView>().To<UnsyncedCommitsView>().Named("unsyncedCommitsView");
        Bind<IControlView>().To<SettingsView>().Named("settingsView");
these need to change
        Bind<IControlViewModel>().To<ChangesViewViewModel>()
            .WhenInjectedInto<ChangesView>();
        Bind<IControlViewModel>().To<BranchesViewViewModel>()
            .WhenInjectedInto<BranchesView>();
        Bind<IControlViewModel>().To<UnsyncedCommitsViewViewModel>()
            .WhenInjectedInto<UnsyncedCommitsView>();
        Bind<IControlViewModel>().To<SettingsViewViewModel>()
            .WhenInjectedInto<SettingsView>();
transient
        Bind<ISourceControlProviderFactory>().To<SourceControlProviderFactory>()
            .WhenInjectedInto<SourceControlViewViewModel>();
 
@Mat'sMug Yup, didn't know how to do that at the time.
 
                Bind<IInspection>().ToMethod(
                    c => c.Kernel.Get<IParseTreeInspection>(inspection.FullName));
transient - and quite possibly a dispose bug
.ToMethod might not be ideal here
 
So, the bang syntax only works with Default members that can accept exactly one argument. If the UserMemID=0 attribute is accidentally deleted, then the error is not detected until runtime. So even if you don't explicitly use the bang notation, your tests should use it, if only so they act as a Loss-of-attribute canary.
But maybe that canary can become an RD inspection?
 
How should this be indented:
Private Sub Test()
Dim foo As String, bar As String _
, baz As String _
, somethingElse As String
End Sub
As just a block?
Private Sub Test()
	Dim foo As String, bar As String _
	, baz As String _
	, somethingElse As String
End Sub
 
@Mat'sMug No.
We use that like:
public SourceControlViewViewModel(
    VBE vbe,
    RubberduckParserState state,
    ISinks sinks,
    ISourceControlProviderFactory providerFactory,
    IFolderBrowserFactory folderBrowserFactory,
    ISourceControlConfigProvider configService,
    [Named("changesView")] IControlView changesView,
    [Named("branchesView")] IControlView branchesView,
    [Named("unsyncedCommitsView")] IControlView unsyncedCommitsView,
    [Named("settingsView")] IControlView settingsView,
    ICodePaneWrapperFactory wrapperFactory,
What we really need to do is inject that as an enumerable, since that's what we put it into anyway.
 
1:49 AM
sure, but I don't quite understand NamedScope, and I'd rather avoid it until I do. We're very possibly misusing it, this constructor looks like we should be using custom attributes instead
there are methods like .WhenTargetHas<SomeAttribute>() for this
or yeah, inject an IEnumerable<IControlView> and setup the multibinding properly
 
Yeah, that works.
 
is InThreadScope warranted? perhaps we should change them all to InCallScope
var binding = Bind<CommandBase>().To(command);
transient
 
@Mat'sMug I don't think so.
 
                    binding.When(request => whenCommandMenuItemCondition(request) || whenHooksCondition(request))
                        .InSingletonScope();
right, it's singleton scope
 
> With Align Dims turned on:

Before:
```vb
Private Sub Test()
Dim foo As String, bar As String _
, baz As String _
, somethingElse As String
Dim x As Integer
End Sub
```

After:
```vb
Private Sub Test()
Dim foo As String, bar As String _
, baz As String _
, somethingElse As String
Dim x As Integer
End Sub
```
 
1:53 AM
so... pretty much everything is InSingletonScope, it's scary
 
[Hosch250/Rubberduck] Hosch250 pushed commit 817e2ff9 to unitTests: Tweak SC bindings
 
@Duga yuk
 
Found that one in the wild on SO.
 
@Mat'sMug Quick guess of 20 out of the hundreds of types we have?
 
[Hosch250/Rubberduck] build for commit 817e2ff9 on unitTests: AppVeyor build succeeded
[rubberduck-vba/Rubberduck] build for commit 817e2ff9 on unknown branch: AppVeyor build succeeded
 
1:55 AM
Too much, quite probably, but not everything.
Well, I got 7 hours in. Time to go wash the dishes; I might be able to finish up tonight.
 
I thought that was a question before I followed the link.
Is this reasonable?
Private Sub Test()
    Dim foo        As String, bar As String _
    , baz          As String _
    , somethingElse As String
    Dim x          As Integer
End Sub
 
I suppose...
 
Or rather more reasonable. The original code isn't reasonable...
 
2:13 AM
> Code inspection false positive if the function `Left(string, num)` like this `VBA.Left(string, num)` (might apply to other functions, not tested)

RD 2.0.7.35311
> As it stands, this looks completely by design. The inspection means to say you could be using Left$ (or VBA.Left$) instead. Can you clarify?
> MS-Word content controls have a property called placeholder text which can be set to "" but not vbNullString

RD Code Inspection detects "" in:
`oCCtemp.SetPlaceholderText Text:=""`
and suggests changing to vbNullString, however (in my experience) following this suggestion will crash word.
> Wait a minute, what is VBA.Left actually? The string function would be under the VBA.Strings module...
 
?vba.Left("dafs",2)
da
 
> Can you include a bit of code to reproduce the issue, I'm not very familiar with the MS-Word object model. Thanks!
 
@Duga That sounds more like an MS Word bug than an RD bug.
 
@SlowLearner wtf, how is that even valid.... dammit Microsoft!!!
pretty sure the resolver doesn't handle that
but then again, RD suggesting to change it to Left$ is by design, not a false positive....
 
> @retailcoder my quick check of vba.Le.... and vba.strings.Le.... seem to provide the same options for function selection. I guess I was using some sort of shortcut w/o knowing.... perhaps there should be 2 suggestions pertaining to that line of code:

1. Use the typed function
2. Use the fully qualified context

I didn't understand the explanation for this issue, not clear to me that a $ makes all the difference... but yes happy to clarify that would be the appropriate solution for me.
 
2:26 AM
> Some built-in functions return an implicit Variant, but a strongly-typed, string-returning version exists and should preferably be used, since it avoids implicit string conversion from Variant
 
@Mat'sMug lol I just bashed it into the immediate window and yep.... it works (MS being overly helpful)
 
@Comintern any idea how that "shortcut" even works from a COM perspective?
 
Was just playing around with VBA.Foo in the IDE. The "namespaces" are all apparently optional. It looks like they only narrow the Intellisense list.
 
@Mat'sMug awesome thanks for that article
 
No clue - I've never run into it before. Lemme take a look at the typelib.
 
2:28 AM
Left is a member of VBA.Strings, but is also exposed as a Global
 
must be the module has a global flag
@ThunderFrame ah, that
 
^ That
 
hmm perhaps the resolver is picking it up then
 
^ that
 
lol
 
2:29 AM
v That?
 
^ That!
 
@Mat'sMug I'll provide example for the content control vbnullstring thing later.
 
cool! ...I've no idea what a content control is :-/
 
basically little pockets of xml in a word doc, they can be mapped to custom xml files embedded in the doc
 
that-- == take that
 
2:30 AM
--that
 
Looks like it works to me.
 
dat hidden interface
 
and, as the name suggests, they control the type of content that is valid (date, rich text, plain text, image....)
 
vbNullString is a null string pointer; it's not an empty string. could be that they're not handling it.
that would be a case for an @Ignore annotation IMO
 
Sub foo()

  Dim cc As ContentControl

  Set cc = ThisDocument.ContentControls.Add
  'This fails
  'cc.SetPlaceholderText Text:=vbNullString

  'This works
  cc.SetPlaceholderText Text:=""

End Sub
 
2:36 AM
@Mat'sMug Not exactly:
Debug.Print VarPtr("") '4516464
Debug.Print VarPtr(vbNullString) '4516464
Debug.Print StrPtr("") '347554296
Debug.Print StrPtr(vbNullString) '0
 
unless we completely special-case that specific method call, there's no way we can handle this
@Comintern huh, interesting
I hadn't realized the VarPtr was the same
 
StrPtr points to the data area of the BSTR. VarPtr points to the internal VBA string cache.
 
hmm so it's a MS-Word bug then
 
That's what I'm thinking.
 
cc.SetPlaceholderText Text:=vbNullString & vbNullString
;-)
 
2:38 AM
That's why passing VarPtr(String) to an API function will bomb it.
LOL
 
@ThunderFrame is that serious? cos I'm totally gonna try it :-D
 
yep, works
 
Const EmptyWordPlaceHolderString As String = ""
 
wow - I'm in awe of you guys
 
The vbNullString recommendation has to do with efficiency in string allocation. Defining your own Const does the same thing, as silly as it is.
 
2:42 AM
@comintern
Const EmptyWordPlaceHolderString As Variant = vbNullString
 
const myNULLSTR = vbNullString
?
snap
 
;-)
must be variant to force the implicit type conversion
 
?typename(cvar(vbnullstring))
String
interesting
meh
not really
 
@ThunderFrame Doesn't work. In a Const it will still compile to the null pointer - you need to use an allocated string to change the behavior:
Const EmptyPlaceHolderString As String = vbNullString

Sub test()
    Debug.Print VarPtr(EmptyPlaceHolderString)              '4516464
    Debug.Print VarPtr(vbNullString)                        '4516464
    Debug.Print StrPtr(EmptyPlaceHolderString)              '0
    Debug.Print StrPtr(vbNullString)                        '0
End Sub
Const EmptyPlaceHolderString As String = ""

Sub test()
    Debug.Print VarPtr(EmptyPlaceHolderString)              '4516464
    Debug.Print VarPtr(vbNullString)                        '4516464
    Debug.Print StrPtr(EmptyPlaceHolderString)              '347954112
    Debug.Print StrPtr(vbNullString)                        '0
End Sub
 
Sub foo()

  Const wdPlaceHolderString As Variant = vbNullString

  Dim cc As ContentControl

  Set cc = ThisDocument.ContentControls.Add
  'This works
  cc.SetPlaceholderText Text:=(wdPlaceHolderString)

End Sub
@Comintern ^ Does work
 
2:46 AM
Interesting. Forcing it into a Variant instead of a strongly typed String.
 
@ThunderFrame @Mat'sMug ok, example code done ;-)
 
I wonder if cc.SetPlaceholderText Text:=CVar(vbNullString) works. The Const Variant should still have a null pointer in the data area.
 
maybe it's just MS' way of saying a content control should have an empty string %^)
 
@ThunderFrame out of interest, have you also confirmed that cc.SetPlaceholderText Text:=vbNullString fails on your respective systems. I do know that they behave slightly differently in different versions (me - 2010)
 
I'm on 2013 - still fails
 
2:56 AM
would this be good for the OOP topic on docs?
Sub DoSomething(ByVal value1 As Integer, ByVal value2 As Integer)
    CallStack.Push "Module1", "DoSomething", value1, value2
    Debug.Print CallStack.ToString
    CallStack.Pop
End Sub
outputs
DoSomething 42, 12
at Module1.DoSomething({Integer:42},{Integer:12})
I think I'll put it up on CR first :)
 
Casting to Variant doesn't work. It has to be a Const.
Public Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, _
    ByVal length As Long)

Const wdPlaceHolderString As Variant = vbNullString

Public Type ComVariant
    VarType As Integer
    Reserved1 As Integer
    Reserved2 As Integer
    Reserved3 As Integer
    Data As Long
End Type

Sub Test()
    Dim Raw As ComVariant
    Dim GuineaPig As Variant

    GuineaPig = vbNullString
    CopyMemory Raw, GuineaPig, LenB(Raw)
    Debug.Print Raw.Data        'Prints 0
I'm inclined to think the compiler gives special treatment to Variant types.
 
I'm inclined to think MS broke something there lol
 
LOL
Usually that's my job.
 
or @ThunderFrame's
oh lol, SO
> I'm from Brasil (so my english may be bad)
 
Similarly, why does Excel use a Double for the Left/Top/Height/Width of controls, but a Single for the same properties of a shape!
 
3:02 AM
causality or correlation?
@ThunderFrame because YOU WERE NOT SUPPOSED TO NOTICE THIS
 
well I told MS in 2001
 
are shapes measured in twips?
 
Now I'm going to have to overflow it. MyTextbox.Height = 2 ^ 129: MyShape.Height = MyTextbox.Height
 
Clippy pops up "It looks like you're trying to break Office. Would you like to... gah, nevermind."
7
 
Q: Why can't my Shape be as tall as my monster textbox? I'm from Missouri, (my English bad)
 
3:09 AM
lol
just how many screens is that
 
Clippy pops up "It looks like you're trying to break Office. Would you like to... I'M MELTING! MELLLLTTTTING...."
3
 
LOL
 
"It looks like you're comparing 1.999999999 floating-point numbers"
 
LOL
 
@Mat'sMug I just realized I broke the cache really bad.
Not that it wasn't broken before, but...
Anyway, I'm willing to get the COM references out of the qualified module name right now as part of the fix.
Also, I need a way to get the path of any saved documents because our project ID thing just isn't working.
 
3:17 AM
that's quite an undertaking
 
No, it really isn't.
The only other thing I need is a way to always have access to the VBE.
 
the cleanest way is to ctor-inject a VBE instance
 
If I have access to that as either a static variable or storing it in each qualified module name, I don't need anything but a better project ID based on the project name for unsaved projects and the project filepath for saved projects.
Yup, figured as much.
 
project name for unsaved projects can't work, at least not in Excel
 
I'm fried right now, but I'll start tomorrow if you'll tell me how to get the full filepath of a project from the VBE.
@Mat'sMug Why not? It is always just Book1, Book2, etc.
The saved ones are like Book1.xlsm, &c.
 
3:19 AM
no, it's VBAProject, VBAProject, and VBAProject. Book1 isn't the project's name, it's the host document.
 
But I need to full C:\\Users\\...
@Mat'sMug Sort of.
VBAProject (Book1).
I can get the Book1 part.
 
oh no, DisplayName...
 
Yeah.
 
IOException/COMException galore
 
But, I need the full filepath for the saved ones. Anyone got an idea?
 
3:21 AM
That's stored by the host application. It isn't guaranteed by non-Office hosts.
 
well, of the host we support, all of the document-type modules have a "Name" property.
 
@Comintern I'm guessing that 99%+ of the hosts will have a unique display name for their stuff.
 
the very concept of "saved" is host-specific
 
Powerpoint varies what it shows for document name by the version of PPT
 
In fact, VBA doesn't require the project to be stored in a document, let alone with the document.
 
3:22 AM
^
 
Bother.
 
e.g. Sage 300 macros
 
Corel too
 
IBM Reflection.
 
But our ID thing just isn't working enough.
 
3:23 AM
what's wrong with our ID thing exactly?
 
can't we just reintroduce the DisplayName as a getter?
 
@ThunderFrame we'd need a way that doesn't bring RD to its knees
 
We have a huge issue with copying projects getting the old ID.
 
(we need it to reliably run unit tests when the projects share the same projectname)
 
@ThunderFrame It still is there.
 
3:24 AM
@Hosch250 I call that an edge case
 
The other issue is that we can't rely on the sinks.
 
What's the use case for copying projects?
 
It only brought it to its knees because it was in the ctor? Can't we make it a getter, or a method (to reflect it's expense)?
 
what's up with the sinks?
 
No idea, but I've heard they don't always fire.
 
3:26 AM
@ThunderFrame it brought it to its knees because the getter or method or whatever it's implemented in kept throwing and swallowing exceptions, for each and every declaration, whenever they were iterated
 
Anyway, I'll see what I can do, but I need to A) not have to inject the VBE into the parser state, and B) ensure each project has a unique parser state each parse.
 
uh, wat?
if the RPS is not a singleton, literally everything falls apart. and project A can reference project B, and then project A needs the declarations of project B to resolve correctly.
 
Is the sink problem that they don't fire or that COM Interop completely broke the STA threading model?
 
NVM. The website doesn't have any VBE to inject into the parser state, which was the cause of the crash last time. I can probably get it to inject a mock instead.
@Comintern They fire plenty fine here.
 
@Mat'sMug - I wonder if that was Linq making it expensive. Might be better using direct getters.
 
3:30 AM
no, it was the thousands of swallowed exceptions, 100% certain.
 
yes, but that could have been Linq enumerating the VBIDE Properties collection?
(and, IIRC, displayname was assigned in the ctor)
 
@ThunderFrame It was.
And no, Linq isn't that expensive.
It is more memory expensive than performance expensive, IIRC.
 
so just move it to a getter, and the 3 places that need displayname can get at it?
 
still we create anywhere between 15K and 75K declaration instances on first parse. 75K exceptions costs a shit load.
 
@Hosch250 This dude explains how he screwed over threading and Interop. blogs.msdn.microsoft.com/cbrumme/2004/02/02/…
 
3:33 AM
CE only needs it once per project, or worst case, once per document-type module
 
nothing in Declaration or QualifiedModuleName should throw/catch/swallow an exception, in any case.
 
Specifically "The one place where we violate COM rules is when the COM object’s apartment or context has been torn down. In that case, we will still call IUnknown::Release on the pUnk to try to recover its resources, even though this is strictly illegal. "
 
on the punk, ya
 
Pretty sure that's behind #2130 and company.
 
@Mat'sMug @Comintern @ThunderFrame I'm sure it comes as no surprise but
?selection.Range.ParentContentControl.PlaceholderText = vbnullstring
True
perverse
@Hosch250 didn't mean to leave you out ^^^^ another reason for haters to hate VBA ;-)
 
3:40 AM
@SlowLearner String comparisons are value comparisons, not pointer comparisons. Pretty sure that just does something like call strcmp.
 
thanks - I have much to learn about the inner workings... all the same it's far from intuitive
 
I think I'm starting to hate the VBE at this point. well, its "extensibility" API anyway, and how impossible it is to deal with in .NET and thus to write any stable 64-bit add-in for the VBE. How the f**k does MZ-Tools manage to do its thing. what are we doing wrong?
 
I would imaging that MZ-Tools isn't as intensively hooked into the innards as RD. Is there any MZ-Tools functionality that requires notification of VBE changes in essentially real-time?
 
nope
not that I know of
 
MZ looses track of changes really quick... e.g. do a find and replace, then manually edit a line of code that you know should be in the results and it might not be able to reference it but ... it with 1 click you can refresh the results really quickly
 
3:46 AM
@SlowLearner:
Dim foo As String
Dim bar As String

foo = "foobar"
bar = "foobar"

Debug.Print StrPtr(foo) = StrPtr(bar) 'False
Debug.Print foo = bar 'True
 
thanks, I need to learn this stuff... its the next level for me
 
DoSomething 42, 12, "test"
Runtime error 11: Division by zero
at Module1.TestSomethingElse({Integer:42})
at Module1.DoSomething({Integer:42},{Integer:12},{String:"test"})
I'm liking this
 
it's more the case that I don't see examples like ^^^^ in order to get exposed to the learning... actually that'd be a great one for the documentation (if it's not there already)
 
Add Option Explicit at the top of your module, and watch VBA complain about variable L not being defined. If you mean to compare against a string literal, surround L in quotes then: "L" is a string literal, L is a variable that you haven't declared anywhere. — Mat's Mug 5 mins ago
"I've searched for a day"
yeah, right
 
Replacing the CodePanes with .NET controls will probably do as much for stability as it will for UX - I could almost completely move the parser into managed code and remove the majority of what needs to pass through the Interop layer.
@Mat'sMug Maybe he Googles like he codes?
 
3:52 AM
aye. lots of the COM plumbing is only needed because the darn VBIDE API gives us sweet nothing
Sub mdlabkill()
seriously
 
Probably an animal testing spreadsheet.
 
lol
@Comintern getting code pane content (and changes!!) off a managed textbox means the world =)
 
The biggest difficulty is going to be managing the debugger. There isn't a VBIDE method to set a breakpoint.
 
Hmm.. and good ol' SendKeys can't work I guess
 
It does report enough state that we can pick up stepping and set focus on breaks.
I was thinking more along the lines of tapping into the menu command and setting the cursor location.
 
4:01 AM
What if we execute the command ... ^that
 
Not necessarily in that order.
 
We definitely can run any menu command given its ID
 
Luckily, breakpoints don't get saved, but RD would have to track them in parallel with the VBE.
 
I see how debug mode can be is quite a problem
 
I actually played around with setting RD as the active debugger, but the VBE doesn't like that at all.
There are some issues around registering a kernel mode debugger that's running in the context of the currently registered debugger.
 
4:04 AM
how about we just switch off our custom code pane in debug/break mode?
 
That might be a little tacky.
The main hurdles are: Detecting when code is running. Detecting when a breakpoint is hit. Adding and removing breakpoints. Tracking and mirroring breakpoints.
 
@Comintern I'm not sure about that.... after heavy editing I have seen code execution stop in places where a break point had previously been set, no active watches, just some random thing. Closing, opening, saving, renaming didn't fix. Orlando's decomplie VBA did fix. Also, export all modules etc. then delete all, then reimport fixes. Just saying (although, I might have missed the thrust of your comment)...
mind you, it could have been that my project had picked up a few corruptions along the way... it's just that SOMEHOW it stopped where the old breakpoints were.... something deepanddark
 
@SlowLearner - There's a known Office/VBE issue related to that. Search for "Can't enter break mode at this time".
 
@Comintern haha, I encountered that error when I was toying with generated code
9
Q: Generating and calling code on the fly

Mat's MugDelegate This class module defines what I'm calling, in this context, a Delegate - here a function that can take a number of parameters, evaluate a result, and return a value. Close enough to the actual "delegate" thing I find. Example usage Set x = Delegate.Create("(x) => MsgBox(""Hello, "" & x

you can't break in a procedure you've generated at runtime
I never encountered it otherwise though
 
Yep, that would do it. You can do the same thing by deleting running code.
 
4:12 AM
@Comintern Nope, I think this is different... I've seen the can't enter break mode message, but this is where the code just stops. Even after clear all break points...
no error message / notification involved
 
I guess the break wasn't a Debug.Assert call
 
Nope... it was just a line of code that previously had a break point. The ONLY ways to fix the issue was to decompile or Export, Delete and re-Import all the modules.
 
methinks MS-Word has shiny ways of breaking its VBA code
 
@SlowLearner - It corrupts the compiled code that get stored in the document. The error comes from having debugging symbols that don't match up with the source code.
It's similar to running an executable with a mismatched .pdb file.
 
and code execution just stopped and I was like WTF did you stop for and @Mat'sMug yes you are right - word is a special kind of s#!t
 
4:16 AM
huh, now that you mention it, I did experience this in Excel 2003 a while back
 
@Comintern so... is that not the same as saving breakpoints?
 
Visual Studio handles it fairly well and tells you that the code doesn't match the symbol set. But the VBE doesn't handle it well.
 
aye. you get hollow breakpoints in VS
 
I'm a serial decompiler
3
 
Yes and no. The breakpoints don't get saved - those are inserted into the executable when it is run in a debugging context. That gets handled on the VBE side. They don't get saved in the compiled code, but they do have to match the symbol set in order for the VBE to set focus to the appropriate code line.
The debugging symbols are separate from the executable.
 
4:19 AM
wait a sec... and you're trying to tap into that to get the custom code pane to work in debug mode??
 
cool - well I just thought I'd mention it, just in case it triggered a shadow of doubt
 
Basically, the kernel generates an interrupt request that gets passed to the registered debugger. The debugger loads the symbol set and translates it to the code.
@Mat'sMug I took a stab at it, yes. :-)
 
dayum
 
That part isn't that difficult. The difficult part is running in the same thread as the debugging thread, de-registering a debugger that you don't own the process for, and replacing it with your own thread in the same process.
 
sounds like heart surgery... or brain transplant
 
4:22 AM
Transplant definately.
Visual Studio gives that dialog that there is already another debugger attached to the process when you try something similar with .NET code.
Note that VS has you manually detach the existing debugger, and that only works about 10% of the time with unmanaged code.
 
ouch
 
I didn't have high expectations going into it.
 
I'd go for a tacky edit-only code pane then :)
 
LOL
 
> : Rubberduck code pane disappears in debug/break mode
 
4:28 AM
LOL - No need really, in order to switch back to the VBE UI RD would need to detect that a breakpoint was hit anyway. As long as it can detect that, what gets presented to the user is the easy part.
 
hmm
 
4:40 AM
Does VBProject have some sort of mode changed event?
Polling it for vbext_vm_Break would suck.
 
yet.... there's no such event
 
I already tried hooking the debug API in kernel32, but that was a non-starter.
Anyway, I'll sleep on it.
 
'night!
 

« first day (781 days earlier)      last day (2399 days later) »