Category Archives: .NET

IE8 smashes Visual Studio 2005 / 2008 Class-Wizard

It seems that the new IE8 has some conflicts with Visual Studio 2008 (incl. SP1). After you installed IE8, you are not able to use the call-wizard for MFC projects anymore. It always gives you an error that there is a bug on the page:
Visual Studio 2008 bug after installing IE8

Currently there is a workaround, until a “real” fix is present:

  • Open regedit
  • Under HKEY_CURRENT_USER \ Software \ Microsoft \ Windows \ CurrentVersion \ Internet Settings \ Zones
    create a new key called 1000 (if it isn’t already there)
  • Under 1000, create a DWORD entry with:
    • Name = 1207
    • Type = REG_DWORD
    • Data = 0x000000

Visual Studio 2008 hotfix for IE8

You can also download the zipped reg-file.

Just for completeness: There is a connect entry since 9 days…

Addition: The problem also occurs with VS2005 (and maybe earlier versions 😉 )

More infos is available from the VC-Teamblog.

Change of Win-API semantics via application manifest!

Starting with Windows 7, the application manifest is becoming more and more important.

In Windows Vista, you need a manifest to bypass the application virtualization. In Window 7, you need a specific application compatibility-manifest to get correct API function behaviour 😉
For example, a race condition in GetOverlappedResult is only solved, if you explicit specify in your manifest, that you want a correct behaviour of this function.
Also a bug in CreateFileEx is only solved if you specify this in your manifest.

Of course, this is in general not a bad idea. But the manifest only allows to enable all new features or nothing. There is no way to exlicit enable only one of the bugfixes.

Here is just a small document of the “Windows 7 – Application Manifests – Compatibility”.

Windows Communication Protocols

Microsoft is publishing many of their “closed” protocols on the internet.
The starting site is: Microsoft Protocol Programs and Open Specifications.

Here is just a small list of available protocol downloads:

All-in-One Code Framework

If you need examples of some of the current Microsoft technologies, you have many technologies and programming languages available. For each of these technologies/languages you need to find a fitting example.

On CodePlex there is now an example-collection for most of the available technologies (COM, ActiveX-Control, ActiveX-Host, ADO, ADO.NET, Outlook-Customizing, DLL, DLL-delay-loaded, LIB, P/Invoke, CLR-hosting / named-pipes, mailslots, shared-memory, remoting) and programming languages (C/C++ (native / MFC / ATL) / C# / VB.NET):

Check out: All-In-One Code Framework

Windows 7 Beta UAC “improvements”

In the Windows 7 Beta 1, there is a new “feature” in UAC (User Account Control). This new feature seems to help reduce UAC-Dialogs in specific situations, by selecting one of the follwing settings:

  • Always notify on every system change (seems to be the Vista-Style
  • Notify me only when programs try to make changes to my computer.
  • Notify me only when programs try to make changes to my computer, without using the Secure Desktop.
  • Never notify.

This sound really great!
But after looking at this, I thought: How the hell did they implement this? Will there be a list of APIs which are “safe-to-call” in one of the settings?

But after reading this answer from an MS guy in the kernel newsgroup, I could not laugh anymore…
This solution only accepts changed from MS applications!
This solution is one of the the worsts solution and might lead to some work for lawyers… but I hope that this is only a beta feature and will either be removed or opened for other (signed) apps.

I will wait and see…

MiniDump support in .NET4

After reading this post (CLR 4.0 advancements in diagnostics) I was happy that now the CLR team is investing resources in better debugging of minidumps.
I made a small example in C#4 and wanted to try this new feature in the VS2010CTP version. You just need to double-click on the dmp-file. It will start VS2010CTP. Then you will need to “start debugging” (for example press F10), and then you will get the following result-screen:
VS20010 CTP Mini-Dump debugging
So it seems that it works “mostly”. But the debugger seems to forget to switch to the exception callstack and instead displays the “minidump-writing callstack”. Hopefully this will be fixed in one of the next (beta) releases.
Here is the link to my connect-feedback: Debugging (managed) MiniDumps displays the writing-callstack and not the exception-callstack

VS2008 Service Pack 1 is available!

Today, the first service pack for Visual Studio 2008 has shipped:

But it seems that the installer is not very user-friendly:

If you previously installed a Visual Studio 2008 Hotfix, you must run the Hotfix Cleanup Utility before installing Visual Studio 2008 SP1. For more information, see Visual Studio 2008 Hotfix Cleanup Utility for Installing Visual Studio 2008 SP1.

Also, the KB article with the list of all fixes is not yet updated:

Hopefully this SP will fix many bugs 😉

marshal_as library in VC2008

The VC++ team added a (simple) marshal_as library in VC2008. But this library only supports simple datatypes like

  • String^ to char* / wchar_t* / BSTR / bstr_t / CComBSTR / std::string / std::wstring / CString<char> / CString<wchar_t>  and vice versa
  • IntPtr to HANDLE  and vice/versa

So, the support only contains “Strings” and “Handle”. But this are the most commonly needed scenarios for marshaling.
The usage of some of the string marshaling is shown here:

An overview of the build-in marshaling can be found here: Overview of Marshaling in C++

There is a website (, in which you can look-up additional marshaling implementations like:

Hopefully many, more will follow…
If you have an implementation of some kind of “marshal_as”, just put a comment to Kate Gregory

Want to download the complete .NET source code?

In one of my last posts I said that the .NET source code is available. While this is still true, you might have seens some trouble in getting the source, because the source is only available on demand while debugging a component. Also you must setup VS to retrive the source/PDBs.

But if you just want to look at the source, there was no easy way to do this.

On CodePlex there is now a tool called NetMassDownloader, which allows to download the complete source (or only from indivudual DLLs) to a directory.

Have fun!

A new team is now improving MSDN Help!

Since VS2002 the new help system was really bad. And it got even worser in every release of visual studio. The slowest version was starting with VS2005 and VS2008. Now MS has heard us!

April announced on her weblog, that MS has now set up a new team to “redesign” the MSDN Help system:

Help is Getting Help – The Long Overdue Makeover for Visual Studio and MSDN Help

Really great news! Hopefully this project will be successful!

TechEd-Developer Session: VC++ and Windows Vista: A Natural Fit

Kate Gregory showed that C++/CLI is the best and sometimes the only (allowed) language to access all the Vista features.
In short:

  • Only in VC++ you can access all Vista features
  • Some Vista features are easier to access from VC++
  • Some Vista features are only accessible from VC++ 😉
  • Some Vista features must be written in native code (like PropertyHandler, ThumbnailHandler)
  • C++/CLI is a “natural” and “must have” tool to fully develop for Windows Vista
  • C++/CLI is the best language for InterOp

The first impressions about TechEd Developer / Great news about C++

Maybe my exüectatiosn were too high… in general I would say that most of the sessions do not go deep. Mostly they only touch the surface…

Of course, there are also some exceptions: All C++ sessions are realy great!

The first session was “What’s new in Visual C++ 2008”. Just a short overview:

  • Vista only: In the Project Properties under “Manifest” you now can explicite set the UAC-Level (asInvoker, highestAvailability, requireAdministrator); so no need to specify this “by hand”; if you upgrade your project it will by default generate an manifest with UAC set to “asInvoker”, so you do not face virtualization problems under Vista
  • Class designer for C++; but only for viewing; there is currently now two-way direction for editing in the class designer and reflection this changes in he code; but better than nothing…
  • Vista-only: Randomizing the base address; this allows vista to use a random base address at startup; this helps to prevent code-injection into the process; this is also on by default for all MS DLLs. Also you can mark your program that it can deal with “data execution prevention /NXCOMPAT)
  • Multiprocessor build for cl.exe! This is also great news! It will allow to speed up the build process even if you just have one project (in VS2005 multi processor support was only possible if you had many solutioons which did not depend on each other)
  • Incremental build for managed code
  • Many areas with performance improvements in VS2005, like: Load solution performance, editor/IntelliSense responsiveness

The second session was “Best practices for Native-Managed InterOp in VC++ 2008 ; also a short summary:

  • Introduction to STL.NET (STL which can be used with managed types); these system is faster than the .NET collections 😉
  • Marshaling Library (marshal_as<to> (from) ); this is a very exciting feature and can be extended with only implementations

So today, we can be look forward to see the two sessions about C++/CLI with Vista and MFC-Updates!

Stay tuned…

First day (5.11.2007) at TechEd Barcelona…

Ok, the first day has started with nice 16 degree Celcius 😉

The plane was a bit too late so I missed parts of the keynote. The biggest news (for me) from the keynote is, that VS2008 will be available late this month to all MSDN subscribers.

In an other session someone from MS (Steven Martin) announced a new tool for model design which will replace all various existing tools (codename Oslo). The release will be Orcas+1 😉

In an other session, Matt Winkler (somehow looks like Don Box 😉 ) and David Aiken showed an example (DinnerNow) of an application by using over 20 of the newest MS technics: starting from WCF over WPF, AJAX, Vista-Gadgets, Silverlight, PowerShell, Cardspace, MMC-SnapIn, …
Quite impressive what can be done (if you have enought time 😉 ).

Today I will join the second part of the last session, which will explain how the did the whole stuff. Then I will go to an WPF session (Designd Rich Client Experiencse with WPF).

The upcoming C++ sessions:

13:30-14:45 “What’s New in Visual C++ 2008?”

9:00-10:15 “C++/CLI and Windows Vista: A Natural Fit”
15:15-17:00 “MFC Updates for Visual Studio 2008 and Beyond”

9:00-10:15: “Exploring the Upcoming C++ Standard: C++ 0x and TR1”

TechEd-Developer in Barcelona!

Currently I pack my bag, so I can fly to Barcelona and visit the biggest european developer conference for Microsoft products from 5th until 9th November 2007.

I think this event will be a great presentation of the new products from microsoft. Also you have the opportunity to meet several program managers from the various product teams and share you oppinion about the products.

You can also meet me at the ATE (Ask the expert) lounge at station 33/34!

See you!