Closures in VB Part 4: Variable Lifetime

For previous articles in this series please see Part 1: Introduction Part 2: Method Calls Part 3: Scope Sorry for the long delay between posts here.  We’re getting Orcas out the door and getting this series completed takes a back door to shipping.  Originally I wanted to talk about looping structures next.  However when I…


Closures in VB Part 3: Scope

For previous articles in this series please see Part 1: Introduction Part 2: Method Calls Thus far in the series we’ve only lifted variables that are declared in the same block/scope. What happens if we lift variables in different scope?  The answer is that one closure class will be created for every unique scope where a…


Closures in VB Part 2: Method Calls

For previous articles in this series, please see Part 1 – The basics This part of the series will focus on how method calls are handled in closures.  As stated in the previous article, the purpose of closures is to allow all operations inside a lambda or query expression that would normally be available inside the…


Closures in VB: Part 1

One of the features I implemented for VB 9.0 is lexical closure support.  This a great addition to the VB language and I wanted to do a series of blog posts to describe this feature and how it will impact your code. Lexical Closures (more often referred to as simply Closures) are the underpinnings for…


CoSetProxyBlanket and Managed Code

When running FxCop on any managed code that uses CoSetProxyBlanket you will see an error message saying the method cannot be called reliably from managed code.  I’ve hit that message before was frustrated by my attempts to find an explanation on the web.  Part of the reason is I’m not the most efficient searcher on the…


Debugging Managed Code with Object ID’s

Just found out about a neat way to keep track of managed object references while debugging.  Check out this blog entry


Readonly TextBox that doesn’t look funny

When you make a WinForm TextBox ReadOnly, it aquires a distinctive look because it changes the background.  Users often want the appearance of the TextBox to stay the same, they just don’t want it to be mutable.  Here’s a snippet to make a TextBox ReadOnly and not change it’s appearance. Dim saved As Color =…


Serialization, understanding the problem

Writing a proper serialization mechanism is ofter very difficult.  The problem is most people don’t realize this because it just works in their application and .Net makes it very easy to do.  A lot of the problem is not understanding what factors you need to consider when writing a serializer. Failures with serialization can be…


Publishing Web Application Projects via FTP

Web Application projects are a new project type in Visual Studio 2005 SP1.  It almost all of the niceties of the web projects with the semantics of being contained within a class library project.  I like the feel of them and do all of my web app development in them now. I just ran into…


Boolean Parameters

An item I try to avoid in any API I create are methods which … Take more than one parameter One of the parameters is a boolean Typically this pattern indicates a True/False option on an operation type.  This boolean value turns on or off some type of scenario for that operation.  The reason I…