StackOverflow with ListBox or ListView
I have been writing some multi-threaded code recently where I was initially adding items to the .NET ListBox control and then later changed to the ListView control. In both cases my code I would get a StackOverflow exception fairly consistently when I added the 224th item (my first two items I added manually so it was the 222nd item added via a separate thread). The first troubleshooting tip is that you do not have an infinite loop, which I could confirm that it did not have.
So the first thing I tried, was to limit the number of items which would be added with each button click. Doing this enabled me to go well over the 224/222 limit from before – thus eliminating any thoughts of limit on the number of items the controls could handle.
After some other failed tests I found out it was how I was handling the cross thread communication, being that I had a separate thread add the items to the control which was created on the applications main thread. To handle to cross threaded communication I kept calling this.BeginInvoke, however I never called this.EndInvoke which a lot of places seem to say it is fine. However at some point it will fail, with the StackOverflow exception – that point is dependant on a number of factors (including the worst factor of all: timing, making this one of those issues that may only appear in the field).
My solution was simple, change the standard this.Invoke method and the issue went away.
For the search engines the full exception is “An unhandled exception of type 'System.StackOverflowException' occurred in System.Windows.Forms.dll”.
Most Valuable Indian
So yesterday I posted about myself getting the MVP award, well today it got better as my friend, co-worker, fellow VSTS Ranger and S.A. Architect lead: Zayd Kara has also been awarded a MVP for his work with Team System! Congratulations Zayd!
And the award goes to...

With the count down clock at T-10 days to my sabbatical trip an email popped into my mail box… it was an email from Microsoft congratulating me on getting the MVP (Most Valuable Professional) award for my work with Team System!
What is this MVP Award?
The Microsoft MVP Award is an annual award that recognizes exceptional technology community leaders worldwide who actively share their high quality, real world expertise with users and Microsoft… With fewer than 5,000 awardees worldwide, Microsoft MVPs represent a highly select group of experts. MVPs share a deep commitment to community and a willingness to help others. They represent the diversity of today’s technical communities. MVPs are present in over 90 countries, spanning more than 30 languages, and over 90 Microsoft technologies. MVPs share a passion for technology, a willingness to help others, and a commitment to community. These are the qualities that make MVPs exceptional community leaders. MVPs’ efforts enhance people’s lives and contribute to our industry’s success in many ways. By sharing their knowledge and experiences, and providing objective feedback, they help people solve problems and discover new capabilities every day. MVPs are technology’s best and brightest…
Richard Kaplin, Microsoft Corporate Vice President
So this is a great honour for me to be welcomed into a group of people who I look up to and respect :) You can see my new MVP profile up at https://mvp.support.microsoft.com/profile/Robert.MacLean
Presentation Data Dump
Over the last year I have done a number of presentations and recently some of uploaded them (unfortunately I cannot upload all, as some contain NDA information) to SlideShare so here is the collection of presentations from the last 15 months or so, in no particular order:
- ASP.NET Dynamic Data
- JSON and REST
- What’s Microsoft CRM all about?
- Source Control 101
- SQL Server Integration Services
- ASP.NET MVC
- What’s new in the .NET Framework 3.5 SP 1
Click the read more link to see and download them...
ASP.NET Dynamic Data
JSON and REST
What’s Microsoft CRM all about?
Source Control 101
SQL Server Integration Services
ASP.NET MVC
What’s new in the .NET Framework 3.5 SP 1
T-34 days and counting...
This morning I got up for a quick cycle and as I road up the last big hill before I got home the sun really started to beat down on me and the swet changed from cooling moist to dripping. This is all at 6am, which is normal for a South African summer day, in fact our winters, in Johannesburg, aren’t too bad too. It normally is around single digits in winter at night and the days go up to 14 or so degrees. I guess that is why Willy-Peter decided to send me this picture – it’s a warning that better go shopping for a jacket or nine.
T-40 days and counting...
In 40 days I will be starting a very exciting adventure, that being flying to Canada and America for 3 weeks of what is being referred to as the Rangers Sabbatical. The what? you may be asking yourself, I have posted previously on my Microsoft VSTS Rangers project involvement. Well in January I will be heading to hang out with with Willy-Peter Schaub at the MCDC (Microsoft Canada Development Centre) in Vancouver Canada and then Chuck Sterling at Microsoft Corp HQ in Redmond, USA.
I am hoping to be able to blog a lot about this trip, although I doubt that I will be allowed to share photo’s of that central server that Microsoft runs that all traffic on the internet run though which is built on Linux (that is a joke for those with humour issues), since this will be the first time I will be going to north America and so this is really going to be an exciting adventure.
Google Maps City More Info
I was answering a question on World Cup 2010 Dizcus and found an amazing feature on Google Maps. I was looking for maps of cities in SA, and I stumbled across this cool more info link.
More info takes you to a portal for the city with information on the time & timezone, a high view map of the area, photos and videos of the town, popular places and related maps. This is a great resource when you are looking for information on a city that you have never been too! Below is a screen shot from my home town of Johannesburg.
Dev4Devs - 28 November 2009
Well today is the day! Dev4Dev’s is happening at Microsoft this morning and I will be speaking on 10 12 new features in the Visual Studio 2010 IDE. For anyone wanting the slide deck and demo application I used you can grab them below.
The slide deck is more than the 6 visible slides, there is in fact 19 slides which cover the various demos and have more information on them so you too can present this to family and friends :)
Has Nokia stopped piracy?
The Nokia 5800 I have runs on the Symbian S60 5th Edition operating system and it seems to be a decent OS, but built into it is the most interesting anti-piracy system I have seen. So how does it work? Note: I am not an expert in this, this is my view after a few weeks looking into it, so I may be wrong.
First every application needs to specify what features it uses and based on that it can either be flagged into one of three categories:
- Unprotected
- Protected
- Testing
Testing has no security, and is just good for testing. However for the other two, they must be signed with a SSL certificate. For unprotected applications you can self sign, in other words using the certificate on the phone to sign the application. For protected you’ll need a certificate from a certificate signing website - which there are just a few of and these sites also require you to signup as a publisher which costs $200. So once you pay $200 and you go through the process you can sign an application however it is locked to the IMEI of the phone. This means that the application can only ever be run on a specific phone.
Now the security model falls over, if you go out and get the publisher details since you could take other peoples applications and strip out the existing certificate and sign it with your own, but that costs $200 (and you are logging with a central company what software you are signing, so that they may be able to track it). Why I think this works is because almost every single application out there is much cheaper than $200. In fact for $200 you can get so many apps legally that I question who would pay $200 if they were not a legitimate publisher.
I think this process is much better than the iPhone’s app store - since you do not need to get a companies permission to sell the software. You can build it, host it anywhere and viola it is available.
A similar process is available in Windows Vista+ x64 for drivers, which must be also signed in a similar process. I am wondering if this should not occur for all applications in Windows as well - however there are a lot of changes that would need to be implemented.
I won a Soccer World Cup 2010 Jersey!
If you do not live in South Africa, you cannot imagine the excitement what next years soccer world cup is generating. In my view it will be one of the top defining moments for South Africa, up there with the ‘94 elections and '’95 Rugby World Cup. To that end I have been doing my little bit as a local to help out people with sharing knowledge on all things world cup at the Dizcus World Cup website.
If you know StackOverflow/ServerFault/SuperUser then this site follows the same design as them except focused on a non-computer topic. For the rest of you readers, it is just an easy to use website where people post questions and others answer. If you successfully answer a question or answer a question very well you get points.
So Mathew, the site owner, put up a challenge about a month ago where he said the top 5 people, based on points, would get a South African Soccer Jersey! Well I was in the top 5 (I think number 2) and so I got the email today saying I had won a jersey! Thanks Mathew for the jersey and the great website!