# Wednesday, 14 July 2010

Here is something I've been asked more than once, and seen asked on various forums as well. I'll paraphrase rather than quote one specific asker:

We have an application written 15 years ago that's been working flawlessly. But when we run it on Windows 7, the users can't find the files it writes. Worse, there are no error messages, so they think they've saved the files, but when they go to C:\Program Files\MyGreatSoftware\UserExports - the files aren't there! 

Often, the question trails off into a rant about how sneaky and mean Windows 7 is to somehow prevent access to Program Files but not give error messages. The rant might also include a paean to how amazing the lost files were and how many workyears of productivity have been lost now that these files cannot be found, and why this means you can't trust Windows to do something as simple as write a file to the hard drive. Sometimes, the asker has established that this is related to UAC and they are recommending everyone turn it off to avoid this disaster. I thought I would make some less drastic suggestions.

First, your files are not lost. A few people know this, but they then claim the files are almost impossible to find and no end user will ever find them. Let's tackle this one first because if you know this trick you may be able to get by without changing anything else about your application. Tell the user to go to the place they expect to find the files, say C:\Program Files\MyGreatSoftware\UserExports. Then have them look in the toolbar for a button that says Compatibility Files. Click it. Ta-da!

Ok, now the next thing is, why the heck are your files being written there? Because you are trying to write to a protected area and you don't have a manifest. You have several things you can do about this, and they boil down to two main things:

One, don't write to a protected area. You can get this by installing somewhere other than Program Files (not a good idea) or by changing the application to write to a better place. Two, get permission to write to the protected area. This means running as administrator. Train the users to right-click Run As Administrator when they run the app, or train them to set the Compatibility Settings for the app (neither very likely) or ship the application with a manifest that includes requireAdministrator. Now matter how you arrange this second thing, your users are not going to like agreeing to the UAC prompt every darn time. So really, that brings you back to number one, don't write to a protected area. Use AppData instead - there's a simple function call to get that path on any machine (including older XP machines) and you'll be in fine shape. If you think your users can't find that, and the files are for the users and not just some internal settings, then use a folder under Documents - again, there's a simple function call that will get you the path.

If virtualization makes you nuts - that your code thinks it's writing to C:\Program Files\whatever but really it's writing somewhere else, and the OS is cheerfully lying to it and saying all the writes succeeded - then put a manifest on your app. Doesn't matter whether it's requireAdministrator or asInvoker. Doesn't matter whether it's embedded (VS will embed them for you from 2008 on easily, and there are tools that do just manifest adding) or just a file of XML in the same folder as the exe. Once the app has a manifest, virtualization stops. Of course this may mean the users get all kinds of Access Denied errors that they don't like. Now you see why virtualization was invented.

Should you rely on it? No. For one thing, it may go away in some future version of Windows. And it goes away when you add a manifest, which for many people happened when they migrated to a new version of Visual Studio. What you should do is understand it, including how to find the virtual store, so it doesn't make you quite so crazy.

Now go turn UAC back on,

Kate

Wednesday, 14 July 2010 09:25:20 (Eastern Daylight Time, UTC-04:00)  #    
# Thursday, 17 September 2009
Recently, I read an inspiring document. It included these quotes:
  • “Everything is best for something and worst for something else. The trick is knowing for what, when, for whom, and why.” —Bill Buxton
  • “Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.” —Antoine de Saint-Exupery
  • “The ability to simplify means to eliminate the unnecessary so that the necessary may speak.” —Hans Hofmann
  • “Simple things should be simple. Complex things should be possible.”—Alan Kay
  • “Everything should be made as simple as possible, but not simpler.”—Albert Einstein
  • “I have only made this letter longer because I have not the time to make it shorter.”—Blaise Pascal
I especially like the Einstein one, which I've used in works of my own. But what's surprising about these quotes is the document where I found them. It's 828 pages long and most of those 828 pages is more like this:
  • To achieve coolness, start not by thinking about what the technology can do, but by focusing on what your target users really need. Before adding that “cool” feature, make sure there are clear user scenarios that support it.
  • When asking a question, use labels that match the question. For example, provide Yes and No responses to a yes or no question.
  • Don’t give error messages when users aren’t likely to perform an action or change their behavior as the result of the message. If there is no action users can take, or if the problem isn’t significant, suppress the error message.
Can you guess? It's user interface guidelines. Specifically, the Windows User Experience Interaction Guidelines, brought to my attention by Qixing Zheng, a User Experience Advisor with Microsoft Canada, and available on MSDN as a tree of web pages or for download as a single PDF. And man, are they good! The philosophy behind them really resonates with me.  The document starts out very generally, then drills in a bit, then drills in a bit more, then explodes into hundreds of pages of incredible detail about just the right way to use a button or a link or radio boxes or whatever. Here are the headings in a 19-item list that I just love:
  1. Nail the basics
  2. Design experiences, not features
  3. Be great at something
  4. Don’t be all things to all people
  5. Make the hard decisions
  6. Make the experience like a friendly conversation
  7. Do the right thing by default
  8. Make it just work
  9. Ask questions carefully
  10. Make it a pleasure to use
  11. Make it a pleasure to see
  12. Make it responsive
  13. Keep it simple
  14. Avoid bad experiences
  15. Design for common problems
  16. Don’t be annoying
  17. Reduce effort, knowledge, and thought
  18. Follow the guidelines
  19. Test your UI

In the real document, there's a paragraph or so for each of these that flesh it out just a little. But as you read the whole hundreds and hundreds of pages you will see how these 19 concepts are really informing all of it. And I love the courage to stop at 19, a prime number, instead of trying to come up with another one to get a round 20.

I'm only quoting the philosophy stuff here but man, there are plenty of technical details like how far apart to space controls, how to design a good ribbon, choosing your button text, working with pen, touch, keyboard shortcuts, and the mouse, when to use menus and toolbars, when your application should take focus, how long tips should hang around before fading away again, and on and on and on.

Read it, live it, pass it around. See if you can't use some of the philosphy and design guidance in your web apps too.

Kate

Thursday, 17 September 2009 16:02:34 (Eastern Daylight Time, UTC-04:00)  #    
# Saturday, 08 August 2009

Code Pack, or Windows® API Code Pack for Microsoft® .NET Framework to use the official name, has hit 1.0 with the RTM of Windows 7 and is now available for your downloading and coding delight. Yes, two registered trademarks in the name, but still technically not a product. It's the most useful not-a-product I know. The mission statement, if you will, of Code Pack is:

The Windows® API Code Pack for Microsoft® .NET Framework provides a source code library that can be used to access some new Windows 7 features (and some existing features of older versions of Windows operating system) from managed code. These Windows features are not available to developers today in the .NET Framework.

The parenthetical in that description is referring to Vista features like Restart and Recovery and Network Awareness, among others. If you've been playing along throughout the beta period of Windows 7 you probably have three questions:

What's in 1.0 that wasn't in 0.9?

  • Shell Search API support.
  • Drag and Drop functionality for Shell objects.
  • Support for Direct3D and Direct2D interoperability.
  • Support for Typography and Font enumeration DirectWrite APIs.
Will my 0.9 stuff work with RTM or should I get 1.0?
  • You should get 1.0 because it has some bugfixes in it.
Can I use 1.0 on a machine running the RC?
  • Probably, but no guarantees.
To me the biggest thing in this 1.0 release is this:
  • The Code Pack also contains sample applications built using this library. Each sample has a C# version and a VB.NET version and has its own solution file.
That's right. VB samples in 1.0 of something. Thanks for noticing :-).

I am such a huge Code Pack fan (and have had a small hand in its birth) so this is just a wonderful summit to have reached. We've had over 24,000 downloads of Vista Bridge and the pre-release versions of Code Pack, so I am confident a lot of people are able to access Windows 7 features from managed code a lot more easily than they expected to.

Kate
Saturday, 08 August 2009 11:10:52 (Eastern Daylight Time, UTC-04:00)  #    
# Wednesday, 15 July 2009
Finally, XP2Win7 is released! I've been watching this one for a long time. It's designed to show off both Windows 7 features and development good practices. The same binaries behave differently on XP and on 7 - on 7 it lights up and shows 7 features like the taskbar or libraries support, as well as Vista features that never got the attention they deserve like Restart and Recovery.

The application itself is a photo viewer and that makes it a natural fit for hooking into libraries, search and organize, and the preview system. It has an intuitive jump list on the taskbar:

It also uses the new Sensor support, Aero glass effects, trigger-started services for backing up images when a USB key is inserted, MMC and Powershell integration, the new Event Tracing for Windows (ETW) and so much more. This will be your roadmap to Windows 7 development. Of course all the code is available, as well as a simple MSI if you'd just like to play with the application a bit and understand what Windows 7 has to offer.

Get your copy and start learning and exploring!

Kate

Wednesday, 15 July 2009 09:32:56 (Eastern Daylight Time, UTC-04:00)  #    
# Saturday, 11 July 2009
Remember that post by Aaron Margolis I linked to about launching a non elevated app from an elevated one? I mentioned that he'd left the managed version of his code as an exercise for the reader. Well Sasha Goldshtein has taken up that challenge and written the managed code. Not only that, he's added it to his UAC Helpers project on CodePlex, a collection of code that helps you work with UAC. Nice!

Kate

Saturday, 11 July 2009 17:22:20 (Eastern Daylight Time, UTC-04:00)  #    
# Sunday, 21 June 2009

Some simple truths about elevation (as in UAC):

  • A process, once running, cannot elevate itself. You are launched elevated or not.
  • A non elevated process can launch an elevated one. The easiest way is to make a separate exe and embed a manifest, then launch it with ShellExecute.
  • An elevated process, once running, cannot "drop back down" to being elevated. As in the first bullet, you are launched elevated or not.

There are some incredibly complicated ways to launch an elevated process but I don't use them because they are incredibly complicated. But you might have noticed there's a symmetry problem there. Can an elevated process launch a non elevated one? My first answer would be "it doesn't matter, because you shouldn't." My paradigm is that your core app should be non elevated, if at all possible, and if it has one or two admin-ish features, those should be refactored into a separate manifested exe that is launched (from a UI component decorated with the shield), does its stuff and gets out.

However, a case can be made for having some sort of admin app that wants to leverage some other installed application, like Internet Explorer, that could possibly be using a malicious plugin or the like. This admin app would be smart to do its leveraging with a non elevated instance of that application. So how can you do it? Well, according to Aaron Margosis, it's a seven step process in native code. Managed code is left as an exercise for the reader.

If you care, now you know how to do it. And even if you don't care, the symmetry is restored.

Kate

 

Sunday, 21 June 2009 17:30:28 (Eastern Daylight Time, UTC-04:00)  #    
# Monday, 15 June 2009

Version 0.9 of the Windows API Code Pack for the Microsoft .NET Framework was released June 11th. This version works with the RC, adds a number of exciting new Windows 7 features, and also incorporates many of the Vista Bridge features as well. (I posted earlier about the different versions of Vista Bridge and Code Pack.) Not only that, but it features VB samples as well as C# ones! You can also see some videos of the functionality in action.

 

You just won't believe how easy Windows 7 development is from managed code using the Code Pack until you give it a try. Expect to see more releases as the year goes on, and keep talking to the team on Code Gallery.

Kate

Monday, 15 June 2009 21:28:09 (Eastern Daylight Time, UTC-04:00)  #    
# Sunday, 10 May 2009

I haven't put the RC on my laptop yet - too close to Tech Ed for me to mess with important stuff - but I liked this summary from Tim Sneath of what an RC means, and what you should be looking at as a developer. Make sure your application runs properly on Windows 7 to start with (and if it runs on Vista, it will almost certainly run on Windows 7), then look at adding goodies to it that take advantage of what the OS has to offer. He even includes a link to Code Pack. Check it out.

Kate

Sunday, 10 May 2009 20:23:38 (Eastern Daylight Time, UTC-04:00)  #    
# Friday, 08 May 2009

Some people have asked me about the purpose of Vista Bridge now that Code Pack (ok, Windows® API Code Pack for Microsoft® .NET Framework) exists. If you want to use a Vista feature (such as the power management API) you won't find them in Code Pack yet. Vista Bridge is not under active development right now, but you can download and use the wrappers to save time and effort whether you are targeting Windows 7 or Vista. If you run into issues using it on Windows 7, please let the team know using the Discussion tab.

The second question I am getting is about versions. Code Pack 0.8 (no longer available for download) was for build 7000. Code Pack 0.85 (the current version) is for the RC of Windows 7. If you have moved to the RC and something isn't working for you, go and get the latest version because there were a few breaking changes.

Will there be a new version for RTM? Let me just quote from the home page:

Please note that this library is currently a work-in-progress and this release is version 0.85 of this library. The final version of this library will be available around the time of the Windows 7 RTM release. Various features in the library could change between now and final release.

That's pretty transparent, I would say.

Update: 0.8 can still be downloaded. Go to the downloads page and there's a link over to the right.

Friday, 08 May 2009 20:05:40 (Eastern Daylight Time, UTC-04:00)  #    
# Tuesday, 14 April 2009

Do you have a Windows application? Are you curious if it will run well on Windows 7? Would you like to try something a little more technical than "install on Windows 7 and see if it runs?" Then you need the Application Compatibility Toolkit. The latest version, 5.5, is now available. There is documentation for it on TechNet to help you get started.

Kate

 

Tuesday, 14 April 2009 18:28:45 (Eastern Daylight Time, UTC-04:00)  #    
# Sunday, 15 March 2009

Whenever a new OS or major application is released, there's a gap between when people want to start interacting with the functionality and when the .NET Framework supports that interaction. That's only natural - the framework release cycles aren't synced to the OS release cycles. This happened before with Vista, and is happening now with Windows 7. For Vista developers, the Vista Bridge provides easy access from managed code to the fun stuff like Restart and Recovery, Task Dialog, Power Awareness and so on. Stay tuned for announcements about a similar library for Windows 7. In the meantime some slightly more granular wrappers are available for you to use now, covering Taskbar, Libraries, Sensors, and Multi-Touch. Alon's blog has the details and the links.

Kate

Sunday, 15 March 2009 17:20:56 (Eastern Standard Time, UTC-05:00)  #    
# Saturday, 07 March 2009

A lot of applications like to know what version of the operating system they are running on. Sometimes (especially older applications) it's so they can flat-out refuse to run if you're still on, say Windows 98. This is now frowned on, by the way, and if you want a Windows 7 logo you must not refuse to run based on a version check. Other times (and this is bad too) it's as part of some arcane roll-your-own strategy. For example someone I know planned to work out the default hard code paths for user documents (C:\Documents and Settings\ ... vs C:\users\... ) based on OS versions. This is insane! There's already a function you can call that will get you that path, and it works even if the user has changed it from the default.

But there are still legitimate reasons for version checking. If you're using Vista or Windows7 light-up features like the Task Dialog, Restart and Recovery, or Taskbar Jump Lists, you'd better make sure you're on an OS that supports those features. It's pretty easy from managed code: just call System.Environment.OSVersion.Version.Major and System.Environment.OSVersion.Version.Minor. From native code, GetVersionEx() does the same job. Then you have to do some comparing. That's where things can get weird.

For example, a huge incompatibility bucket for Vista was applications whose code checked that the version was exactly 5.1. If not, it would pop up a message box saying it only ran on XP SP2 or better. I've seen these apps in the wild and I just can't keep from laughing. The error message itself says "or better", and that was presumably the intent, but the code is checking for equality. The magic of >= fixes this "incompatibility" bug in the code, and often these applications don't need any other fixes to make them work on newer OS versions. (That's why the logo people frown on refusing to run. How can you know you won't work on a later OS that doesn't exist yet?)

Even if you grasp the magic of >=, comparing major and minor versions can bite you. Larry Osterman shows us this code:

// Example in C#.
 
internal bool SupportsTaskProgress() {
    if (System.Environment.OSVersion.Version.Major >= 6) {
        if (System.Environment.OSVersion.Version.Minor >= 1) {
            return true;
        }
    }
    return false;
}

He rightly points out it will return false if the version is 7.0, or 8.0, or any other .0 that's larger than 6. (Yes, Windows 7 returns 6.1 for the version #, that's a long story and well covered elsewhere.)

Version checking is hard. If you can, use a library that does it for you. Vista Bridge, for example, not only wraps up cool new OS features for easy access from managed code, it also does some checking to see if the feature is there for you or not. Don't reinvent wheels. Also, check for the feature rather than the OS if you can. Larry discusses this in his post for Taskbar features. Any feature you plan to use, you should know how to check for. I hope to post some more links and examples on this soon.

Kate

 

Saturday, 07 March 2009 10:45:31 (Eastern Standard Time, UTC-05:00)  #    
# Friday, 06 February 2009

I've been saying for a while that the Vista Bridge is now a living project that gets updated. And here we have our second Code Gallery release already. I think it's worth saying again what I said when 1.3 was released:

Here you can download the latest version, join discussions, and report issues including native APIs you wish were wrapped. Remember, this is a sample library, not a product, so don't expect the kind of support, internationalization, or full coverage a product would have. Do expect useful code for reading (if you care about how to do interop well) or just using (if you want to light up your application with Vista features without knowing about interop.)

I've been doing quite a lot of speaking on this wrapper library and it really makes all the difference in the world if you'd like to adopt the latest OS functionality from your managed (C# or VB.NET) application.

I did a quick search to see who had been writing about our library and was a little surprised to find a Wikipedia entry: http://en.wikipedia.org/wiki/Vista_Bridge. But it turns out that's about an actual bridge, that cars drive on, on Vista Avenue in Portland Oregon. Ah well.

Kate

Friday, 06 February 2009 16:19:58 (Eastern Standard Time, UTC-05:00)  #    
# Sunday, 01 February 2009

While I was in Redmond I met Alon Fliess, who like me is a C++ MVP and is exploring Windows 7 (and Vista before it) from a native point of view as well as a managed one. About two months ago he mused about the "rebirth" of C++ in these times, not just because some of those operating system APIs are easier to get to from native code, but also because of new native capabilities (the continued MFC updates, the native Web Services library, the concurrency services) that just keep being added to the arsenal available to C++ programmers. (He has some helpful links in the blog post - you could also search through here if you like.)

I think it's a good point. If you know C++, now's a good time to use it. If you don't, then hang around (at least virtually) with those who do - we can point out some cool things. And thanks to the magic of interop, wrappers, and C++/CLI, perhaps we can make some of those cool things a little easier to get to from managed code.

Kate

Sunday, 01 February 2009 09:12:13 (Eastern Standard Time, UTC-05:00)  #    
# Tuesday, 20 January 2009

Anyone who blogs on technical topics soon notices they get a lot more hits if they wander into non technical areas for a post or two. That’s just because there are more non technical people out there, searching for tips on stain removal or coupons for TGI Fridays, than there are people who want to know how to get a manifest on an executable or how to write a C++/CLI wrapper for native code or what’s coming in Visual Studio 2010. That’s why my top ten posts last year are:

1 - XPS Document Viewer – Nov 19th 2006
I guess people are still getting XPS documents and don’t know how to read them. OK. Not sure why my page would be the one that over 7000 people find, but what the heck, the information is still valid.


2 - Reading Office 2007 files – Nov 23rd 2006
Also from two years ago but people still need to know this. I send people this link whenever I get one of those “I can’t read your attachment because I’m not on Office 2007 yet” replies to an email. I didn’t send it out 4000 times though, so I guess a lot of people are searching for this stuff.


3 - Try Www.mappoint.com – August 18th 2004
I read recently that people don’t seem to realize they can type URLS into the address bar on their browsers, and have their home pages set to search engines, and actually type entire URLS into search boxes so they can click the result. I would deny this could happen, except many years ago I had a client who did just this, so I know there really are people who do this. I also can’t think of any other reason why over 2500 people would read a four year old post comparing MapPoint to MapQuest given that everybody these days uses either maps.google.com or maps.live.com.


4 - Introduction to Workflow in SharePoint 2007 – June 22nd 2006
Yep, workflow was a hugely important addition to SharePoint. We’re loving it in the SharePoint project we’re doing now. Again this is a topic that must surely be better covered somewhere else though. Still almost 2500 people stopped by to learn about workflow – I hope they followed the link to learn more, and learn something a little more recent – say from after the product was released?


5 - How to earn a million Aeroplan miles – Oct 1st 2005
Now this is really non-technical, but it caught my attention and I guess plenty of other people’s too. I have some other blog entries from time to time about Aeroplan miles, but I don’t really cover how to earn them. For that I highly recommend Flyertalk’s Aeroplan forum.


6 - Batch-convert Visual Studio 2005 projects to Visual Studio 2008 – Dec 17th 2007
The most recent entry yet in this top ten. It makes sense that something that gets hits all year does better than something that wasn’t even around for the first half of 2008. And this is a useful tip I haven’t seen many other places. All those searching people should just subscribe to John Robbins – searching only helps you if you know something exists and want to find it. Smart blogs like John show you things you hadn’t imagined existing.


7 - Another Way to Get the Shield on a Button (or Anywhere Else) – Jan 30th 2008
Finally, something from 2008 in the 2008 top ten! And this is a good tip from Daniel Moth. Remember, the shield on a menu item or button doesn’t bring up the UAC prompt any more than putting ... on a menu item brings up a dialog. And nothing puts the shield there for you if you trigger a prompt any more than something puts the ... for you when it sees you have code to show a dialog. All of this is just sensible developer tradition that helps users feel comfortable with the software they’re using. So please play along and help people know what to expect.


8 - Don't compile MFC apps with /clr:pure – Jan 17th 2007
This one seemed like a no-brainer – MFC includes native stuff, /clr:pure means I don’t have any native stuff, but I was getting emails asking for help and this kept turning out to be the issue. So I blogged it. A lot of my blog topics are the answers to random emails I get from people who are looking for help. This way an extra 1500 or so people saw the answer in 2008.


9 - Hot Laptop? Here's a tip – May 14th 2006
It’s still good advice for working with an overheating laptop. I’m not sure if the searchers all had that problem or were using “hot” more metaphorically.


10 - Adding a manifest to a Vista application – Oct 3rd 2006
This is mostly a link over to Catherine Heller’s Visual Studio 2005 instructions, except that I really wanted to call out how much less work it was for Visual C++ compared to C# and VB.NET. Anyway it’s all a ton easier with Visual Studio 2008 these days.


What else can I tell you from my stats? I got almost a million visits over the year, and they averaged 2.71 requests – meaning most folks clicked around a bit once they arrived. That’s heartening. In 2008 I set myself a goal to blog every day. I didn’t achieve that – there were several long gaps in there – but I did post 135 times. I still like the quote from my post on June 1st, resuming after a four-month gap: “Blogging, like speaking at a Quaker meeting, is something one must do only if the spirit moves one.” I’m looking forward to having my spirit move me hundreds of times in 2009.

Kate

Tuesday, 20 January 2009 22:07:58 (Eastern Standard Time, UTC-05:00)  #    
# Thursday, 13 November 2008

Just in time for my Tech Ed Day 4 talk, we have the long awaited arrival of the Vista Bridge Samples Library, version 1.3, on the MSDN Code Gallery:

Here you can download the latest version, join discussions, and report issues including native APIs you wish were wrapped. Remember, this is a sample library, not a product, so don't expect the kind of support, internationalization, or full coverage a product would have. Do expect useful code for reading (if you care about how to do interop well) or just using (if you want to light up your application with Vista features without knowing about interop.)

Enjoy! I've been waiting a really long time for this!

Kate

Thursday, 13 November 2008 07:24:47 (Eastern Standard Time, UTC-05:00)  #    
# Sunday, 09 November 2008

These are fun:

I got them from Knom's Developer Corner, a consistent source of goodness.

Wondering why they appear to be on my desktop? Because even in Vista gadgets can be on your desktop. Just drag them there. If you use Windows+D or Alt-Tab your way to the desktop you won't see them, but bring up the sidebar with Windows+Space and the gadgets you put on your desktop will wake up too. Neat trick I learned from a Windows 7 guy :-).

Kate

Sunday, 09 November 2008 10:07:54 (Eastern Standard Time, UTC-05:00)  #    
# Saturday, 08 November 2008

I think I have this finally all sorted out now. This map is a little inaccurate because it depicts driving, but it gets the point across:

Monday December 8th I will fly to Fort Smith (via Atlanta). Tuesday December 9th I will drive to the Northwest Arkansas meeting. Wednesday Dec 10th I will fly from there to Baton Rouge (via Atlanta) and then Thursday Dec 11th I will fly home (once again, via Atlanta.) The talk will be the same at all three, so there's no need to follow me around :-)

The Windows Vista Bridge: How Managed Code Developers Can Easily Access Exciting New Vista Features

Accessing new Windows Vista features is a challenge from managed (.NET) code. The level of interoperability required is out of reach for many developers. The Vista Bridge is a sample library you can use in your own projects today that provides access to new user interface features as well as “behind the scenes” power features. Discover a shortcut to Windows Vista for Microsoft Visual Basic and Visual C# programmers and how you can get involved.

This talk is freshly updated for Tech Ed Europe where I will deliver it Nov 13th. See you there!

Kate

Saturday, 08 November 2008 10:32:26 (Eastern Standard Time, UTC-05:00)  #    
# Saturday, 01 November 2008

One of my demos (OK, more than one) for my upcoming Tech Ed Europe talks is a console application. I find when you're doing complicated concepts like C++ templated code, that adding the plumbing to talk to a Windows application (whether MFC, Windows Forms, WPF or whatever) can obscure what's going on. Generally speaking people can follow cout << i << endl; just fine and it reduces the header files and so on that are needed to use the sample.

I had one problem though - on this machine, when debugging a console application I couldn't get the Properties of the command prompt to come up when stopped at a breakpoint, and of course the command prompt disappears as soon as the program finishes running. I could change the properties in the command prompt you get for "start without debugging" but they had no effect on the debug one. The font was too tiny to use in a presentation:

Here's what I did. I brought up any old command prompt, right-clicked in the title bar, and chose Defaults instead of Properties. This affects every command prompt on your machine at once. I switched to Lucida Console and a bigger size, and closed the command prompt, then debugged my console application again:

Do I care that the font is now big in all my other command prompts? Not really. I suppose if I did I could deal with their properties one by one.

Kate

Saturday, 01 November 2008 11:01:15 (Eastern Standard Time, UTC-05:00)  #    
# Thursday, 30 October 2008

Did you get a set of DVDs for Tech Ed USA this year? I did, and I find them incredibly valuable. But when I went to use one recently, I had a problem: it asked me to install Silverlight. That was weird, since I have Silverlight - in fact I have the latest version. But when I clicked the link, the problem got worse:

I contacted the folks in charge of the DVDs and they told me that in fact you can still get to all the content as long as you know the session code. The only hard part is finding the right disk. Then you browse to the folder for the session:

Once there, double click Player.wms and you should be all set.

 

I shrank the picture so it would fit in the blog - the text looks perfectly normal in real life.

The online site has been updated to Silverlight 2, but this lets you continue to use your DVDs. There's also a handy index of talk titles and speaker names, which I have been permitted to upload. It's an attachment to this post.

So enjoy your Tech Ed content!

Kate

TechEd 2008 North America DVD Compatibility Issues.pdf (617.2 KB)
Thursday, 30 October 2008 14:52:24 (Eastern Standard Time, UTC-05:00)  #    
# Tuesday, 28 October 2008

An astonishing thing happened to me on the afternoon of Day 1. I went to the room for the "Parallel Programming for C++ Developers in the Next Version of Microsoft Visual Studio" talk, and the redshirt guarding the entrance said "the room is full you have to go to the overflow room." I tried logic with her "It's a C++ talk! It's can't possibly be full!" but she chose to believe her own eyes. So I walked the hundred miles or so to the overflow room, which itself became full. The audience really enjoyed seeing how simple it can be to take advantage of multicores using templated functions. Lines and lines of boilerplate goo disappear into a library instead of your code, which means people might actually do this. Nice stuff.

Having learned my lesson, I lined up immediately for "Microsoft Visual C++: 10 Is the New 6." The room filled up just as fast:

I don't think I had heard Boris Jabes present before. He was very good indeed. The slide you see in this picture lays out the mission statement for "Dev10", the next version of Visual Studio, as far as the C++ team is concerned: Make VC10 the most productive IDE for native development. Then he proved it to us. Since it was the last talk of the day, people stayed with questions for a long time afterwards. I really enjoyed listening in on those.

Tuesday started with a keynote that really impressed me. Azure is amazing but the gritty details are not there yet. But Windows 7 - it's on the hard drive! It's real! So they showed it to us. Then they started talking about client development. Ray pointed out a number of advantages of writing a Windows application instead of (or as part of a suite that also has) a web app.

I loved the Windows 7 demo. Lots of features there I really want right now. I love Vista, but this is even nicer. And I hear the stability is great already so you could really use it. Julie plugged the Engineering 7 blog I've plugged myself.

Scott Guthrie said C++ five times. I don't think I've ever heard him say it once before.

 

Don't worry, he talked about managed code too. You may think of ScottGu as "the web guy" but he gave client development in general, whether C++ or WPF, some serious love in this talk. Great announcements too - grid control for one!

Want one more inside joke explained? (I just love the RD alias for this sort of stuff!)

David Treadwell's shirt had 0x007FFF embroidered on it. Think of it as 00 7F FF. RGB. Go try it in some HTML. Then think back to Day 1.

Update: better picture of the shirt by Angus Logan. Subtle-as-a-brick demo of the colour by Steve Clayton.

Missed the keynote? Based on the URL to day 1, try http://channel9.msdn.com/pdc2008/KYN02/

Kate

Tuesday, 28 October 2008 13:41:07 (Eastern Standard Time, UTC-05:00)  #    
# Saturday, 25 October 2008

My Tech Ed Europe sessions are confirmed (have been for a while actually) so I had better tell you about them:

See you there!

Kate

Saturday, 25 October 2008 13:18:39 (Eastern Daylight Time, UTC-04:00)  #    
# Sunday, 19 October 2008

Word is starting to spread about the Vista Bridge. Greg Duncan's blog entry on it links to the SDK blog entry and includes a screenshot of the demo. Nice to see awareness growing on this. Interesting link on the side to a buzzword bingo game for Zune. I really need to take a few minutes and get some games onto my Zune to make those plane rides go a little faster...

Kate

Sunday, 19 October 2008 14:53:29 (Eastern Daylight Time, UTC-04:00)  #    
# Sunday, 12 October 2008

I just love the Vista Bridge. I've spoken about it at Tech Ed, on Geekspeek, on DotNetRocks, and pretty much anywhere that will have me (and I have more planned.) Now the Windows SDK team is blogging about it. Yay! They include where to download it, how to make sure you get it when you install the SDK, and some workarounds for some bugs in the samples.

Stay tuned for more Vista Bridge info...

Kate

 

Sunday, 12 October 2008 09:31:02 (Eastern Daylight Time, UTC-04:00)  #    
# Thursday, 09 October 2008

The Engineering 7 blog is really something. These guys are sharing a TON of information about how they decide what will and won't be in the next version of Windows, how it will work, how they will know they're done, and so on. I enjoyed this summary of UAC issues - what they learned from Vista and what they intend to do in Windows 7. Interesting points:

  • Intuitively we all know the number of UAC prompts you see should go down over time, because once you have things installed and configured, you don't run the admin apps any more. But they also go down because you used to run old versions of apps that weren't UAC-aware (think Visual Studio 2005 and having to run it elevated most of the time, especially for ASP.NET work) but later you install a newer version that is aware and doesn't have to run elevated (Hello, Visual Studio 2008!)
  • The number of different applications that cause UAC prompts "in the wild" is down to about one-fifth of what it was when Vista first released. That's a great success for persuading software vendors to get new versions UAC-aware.
  • They plan to add information to the dialogs in Windows 7 so you will understand more clearly what you are being asked to approve.

Can't wait to get to the PDC and learn even more about what Windows 7 will have in store for us!

Kate

Thursday, 09 October 2008 08:33:27 (Eastern Daylight Time, UTC-04:00)  #    
# Friday, 03 October 2008
This pair of podcasts snuck onto the web over the summer. This was a single interview that's been split into two parts, both pretty large files (over a hundred meg.) I talk about C++, Vista, the marshaling library and marshal-as.net, the MFC update, and plenty of other things I've blogged about here before.

Let me know what you think!

http://www.informit.com/podcasts/episode.aspx?e=3a744e05-7893-408d-91de-d73b77ddb832

http://www.informit.com/podcasts/episode.aspx?e=fc209a80-bdd7-42b4-b555-514ce882178b

These are MP4 files. The web page bugged me to install QuickTime and I did and that's what played them. You may have your own preferences - there are download links on each page.

Kate

Friday, 03 October 2008 09:20:07 (Eastern Daylight Time, UTC-04:00)  #    
# Monday, 15 September 2008

At the moment I only have one fall speaking commitment settled and it’s one of my favourites - Tech Ed Developers Europe. Barcelona will be warm, both in the temperature sense and the personal interaction sense (though I do predict exposure to pocket-picking, bag-lifting, and other forms of theft once again). The attendees will be energetic and appreciative. The other speakers will be fun to hang around with. The ancillary events will be fun fun fun.

My topics are the Vista Bridge, and some new C++ features. We’re still working on the abstracts and titles, so I’ll post an update when they’re locked.

See you there!

Monday, 15 September 2008 17:06:49 (Eastern Daylight Time, UTC-04:00)  #    
# Friday, 12 September 2008

Vista gets a lot of bad press it doesn’t really deserve. For example, it crashes way less than XP for me. Some applications behaved oddly at first (primarily because of UAC and Virtualization) but I have either learned workarounds, such as running the app elevated, or upgraded or replaced the apps that were causing trouble. The slow file copy thing drove me insane, but SP1 took care of that. I really have very few complaints left about my computer, and the ones I have are aimed at specific applications (yeah, Outlook 2007, I am looking at you when I say that, and Adobe, don’t think not meeting my eyes will keep you out of my bad books) rather than the operating system.

Still, who wouldn’t want to make their operating system run faster and smoother? Here are some helpful thoughts and guides:

Windows Vista Performance and Tuning. A downloadable paper from Microsoft. Simple stuff here like choosing the right power management plan, using ReadyBoost, tweaking your search settings, and so on. Worth a read.

Vista Annoyances Resolved. Despite being annoyingly spread over 9 pages (see what taking ads does to you?) it has some good stuff. You’ll see explanations of SuperFetch, ReadyBoost, restore points, and more.

Roundtable with Mark Russinovich. An upcoming special roundtable on Vista Performance. Send your questions in ahead of time, then tune in for answers.

Learn a little, enjoy your daily computing life more.

Kate

Friday, 12 September 2008 19:21:46 (Eastern Daylight Time, UTC-04:00)  #    
# Tuesday, 09 September 2008

Whenever an application blows up and offers to send information to Microsoft, please please say yes. On Vista it’s described as “checking for a solution” to make it more obvious what’s in it for you.

Sometimes, when you send this information to the giant Windows Error Reporting mother ship, you get a response that your blowup was caused by a known problem, and a link you can click for more information. That doesn’t happen to me very often, which I guess means I am among the first to find problems in shipping software. But that doesn’t mean you can’t benefit from the fix when the developers finally get around to acting on the reports they get from the WinQual program. Here is something you should do every month or so if you can remember.

First, bring up Problem Reports and Solutions. It’s on the control panel, or just click Start and type Problem, then press enter. You’ll see something like this:

Click View Problem History on the side. You will see a list of stuff that has blown up on your computer over the months.

Interesting, isn’t it? Click the Select all box at the top, and also Check Again For Solutions to Other Problems. Now click the Check for Solutions button. It will go and have a think:

It might also ask you if it can send extra info for some blowups, I always say yes. In for a penny in for a pound eh?

Then, the cool part. New solutions!

Click a link and you’ll get some more info with a link straight to the page that lets you get the update or latest version or whatever that specifically fixes the problem you had on your computer.

You can clear your problem history, but I am not sure why you would. You never know when a fix will show up for a problem you already had.

Kate

Tuesday, 09 September 2008 10:14:33 (Eastern Daylight Time, UTC-04:00)  #    
# Sunday, 07 September 2008

The guys call me a regular now, and I suppose I am. Here’s another hour of rambling and fun covering Vista (especially the Vista Bridge) the Vista things you’re not allowed to implement in managed code, C++, the MFC update, concurrency, and whatever else popped into my head while we were talking.

KateP>

Sunday, 07 September 2008 10:03:39 (Eastern Daylight Time, UTC-04:00)  #    
# Thursday, 04 September 2008

While I was at Tech Ed Developers (US) this summer, I spoke with Craig Shoemaker for his Pixel8 podcast. We talk about UI, and Vista, and the usual things. I have some distinguished company in this interview but if you don’t want to listen to Ted Neward you can zip ahead to the 18 minute mark for me.

Kate

Thursday, 04 September 2008 09:56:06 (Eastern Daylight Time, UTC-04:00)  #    
# Tuesday, 02 September 2008

Tech Ed Developers (Europe) is spotlighting a number of the top sessions from last year, free for anyone to watch. Mark Russinovich (on Wikipedia, his blog) knows more about the internals of Windows than anyone else who’s allowed out in public, and in this session, The Case of the Unexplained... (rated 5 stars out of 5 by attendees), he covers various mystery bugs and how he tracked them down. I’m slightly disappointed that some of the stories ended "so I logged a bug with that team" – I would have loved it if these were all fix-your-config stories, but still to see the techniques is very cool, and if your own code is causing the mystery CPU spike or resource leak, you will really benefit from the tools and approaches Mark shows. Sure, it was at the IT Pro half of Tech Ed, but developers need to know this stuff too!

I would like this stage someday. It's the Barcelona keynote stage, used for wildly popular breakouts also.

Kate

Tuesday, 02 September 2008 09:41:47 (Eastern Daylight Time, UTC-04:00)  #    
# Friday, 27 June 2008

Seriously, once you have installed SP1 of Vista, if you have any more troubles with it, you can get technical support for free.

Free unlimited installation and compatibility support is available for Windows Vista, but only for Service Pack 1 (SP1). This support for SP1 is valid until March 18, 2009. Chat and e-mail support is available only in the United States and Canada.

(Phone support I guess is available worldwide.)

If something still won't work for you on Vista, drop them an email or open a chat session, and get it sorted out. It's free, so why not?

Kate

Friday, 27 June 2008 21:52:02 (Eastern Daylight Time, UTC-04:00)  #    
# Wednesday, 25 June 2008

Before Vista, you could right-click a shortcut, executable, or whatnot and choose Run As ... to run that item as another user. 99 44/100 of the time you wanted to run it as your administrative account, if you were one of the 3 people on the planet who had an administrative account. Occasionally, you were borrowing someone's computer and wanted to run something that relied on Windows integrated security, for which you wanted to be yourself. And more relevantly for me, you might want to demonstrate how Windows integrated security worked, say by having 3 or 4 browsers open that were all authenticated (to Windows itself) as different users.

So if any of that rings a bell for you, you want ShellRunAs. It's free, it's from Microsoft, and it works on Vista.

Kate

Wednesday, 25 June 2008 21:31:10 (Eastern Daylight Time, UTC-04:00)  #    
# Tuesday, 24 June 2008

P/Invoke (aka DllImport) signatures are not the world's most fun things to create. You start with a native declaration, and then hand-map native types to the equivalent (you hope) managed types. If at all possible, you head to www.pinvoke.net and look up the API you are calling and paste in whatever some kind soul put on the wiki. If not, well you have some mechanical work to do.

But now the Interop team has a little tool for you! Look up the API you want, choose a language, click the Generate button and -tada!- your declaration is ready to be copied and pasted. (Even has doc comments explaining the params.) Not calling a well-known API (maybe it's your own code from a native project?) No problem, paste in your native C++ signature and translate. Need to go the other way around (what native signature corresponds to a managed one?) No problem.

Sweet. The code it generates isn't pretty (for example it doesn't add any using/Imports statements, so everything gets the full dotted name every time, and everything is explicitly declared) but then again, who reads generated code? Stick a comment in front of it saying you generated it and leave it alone. Even if it needs a little hand tweaking now and again (and I honestly don't know whether it does or not) it will still save a TON of time. It's on CodePlex, so go get it.

Kate

ps: The list of APIs is in a XML file, and I noticed the Vista-only ones I tried (restart and recovery related mostly) weren't found, so if you wanted to make a contribution to the project...

Tuesday, 24 June 2008 19:56:13 (Eastern Daylight Time, UTC-04:00)  #    
# Monday, 16 June 2008

So you have your app on Vista now and it's working great. It needs to elevate maybe? Or part of it does? And do you cringe a little when you see that An Unidentified Program Wants Access To Your Computer super-scary version of the UAC consent prompt? Would you like to stop being called Unidentified Publisher? Well then you need to sign your application. But how do you do that? How much does it cost? Isn't it hard?

I seem to only have questions in this particular post. Well John Robbins has answers. Check it out. Try it. Let me know if it worked for you.

Kate

Monday, 16 June 2008 23:47:47 (Eastern Daylight Time, UTC-04:00)  #    
# Friday, 13 June 2008

I mentioned in an earlier post that applications with manifests that require Administrator privileges will show up with an overlay icon of the shield on their exe icon in Windows Explorer. Applications with manifests that deny needing Administrator privileges will not get the icon. What about applications without manifests? Well, among other things some Vista heuristics come into play. I found some really old executables (15 year old games) and did a little experiment. Obviously these are manifestless apps. I copied Tetris.exe and renamed the copy Setup.exe. That's all I did. The timestamp is still unchanged. But there's a fairly obvious difference as a result of the rename:

If the file name contains Setup, Patch, or some other magic strings then you will get the overlay and you will be prompted for elevation consent when you run it. (If you're curious, Tetris plays just the same elevated.) Then something fun happens. After you run a file called Setup.exe, if your program files directory is unchanged, your registry is unchanged, your System32 directory is unchanged etc, something is probably wrong. Well, not if you're just playing Tetris, but if the plan was to install something, there's a good chance it didn't install. So Vista says:

If you let it try again, it actually uses Group Policy to store extra information about this application - including whether it needs to elevate or not, should be lied to about Windows version, and other settings you can find on the Compatibility tab of the properties:

Why do you care? You care if Vista has wrongly guessed that an app of yours needs to elevate, and prompts you every time. Understanding these heuristics gets you closer to being able to clear away that overlay icon for your not-administrative-at-all application.

Kate

Friday, 13 June 2008 21:45:22 (Eastern Daylight Time, UTC-04:00)  #    
# Thursday, 12 June 2008

How can you avoid the UAC prompt for applications you frequently run? Well, you could turn off UAC entirely, but that's a bad plan. There are two ways: one is realistic and feasible, and one much less so.

The less feasible one is that you could re-enable the Administrator account (not just some account you happen to have that is in the Adminstrators group, but the actual Administrator account) and log on as that. Pretty much everything you do will be elevated and you won't be prompted about it. But I don't want to do that. I want to log on as me. Plus, I kind of want to control my prompt-noprompt life, or we're right back to malware using my powers without me knowing.

So here's my solution. Get yourself an elevated command prompt (Start menu, spot a command prompt shortcut, right click, Run as Administrator.) Consent once and for all (till your next boot) to elevating that prompt. Now everything you launch from there is elevated, no prompt. Don't believe me? Try regedit. Try notepad. Then try, say, editing your hosts file with that notepad. Cool, no?

Leave the elevated command prompt open, and use it whenever you want to do something elevated. No prompting. You have to type the name of the app (Visual Studio is devenv, which you will care if you're still using 2005.) But pretty painless.

Kate

Thursday, 12 June 2008 21:28:29 (Eastern Daylight Time, UTC-04:00)  #    
# Saturday, 07 June 2008

UAC prompts you whenever you do something that requires your administrator privileges, with a couple of exceptions I'll get to later. Part of not being driven crazy by UAC is coming to expect that prompt. When you choose particular menu items or click particular buttons, you are warned with the shield:

  

What lots of people don't spot is that some executables are also marked with the shield. Compare these two:

One of these will get you a UAC prompt if you run it, and one won't. Once you know to look for it, it's easy to see -- at least down in the properties area with the big thumbnail. Look closely at the little icon in the main part of the window (the icon you would double click) and you'll see it, too.

What puts that icon there? What suppresses that icon? Well these two executables have manifests. One says the exection level is asInvoker and the other says requireAdministrator. So that's a pretty obvious distinction. There are other things that put the overlay there, but thery all boil down to this: if Vista plans to show you a UAC prompt (and there are reasons other than a manifest why it might) it will overlay the icon to warn you.

Remember, though, that the icon on menus and buttons and such is not magically put there by the OS. It's put there by a thoughtful programmer who likes users to know what's going on. The same sort of programmer who puts ... on menu items that will bring up a dialog (take a look at File, Save in almost any program) and omits ... on menu items that will just act (such as File, Close.). If you're programming for Vista, you need to be that kind of programmer.

Kate

Saturday, 07 June 2008 18:11:50 (Eastern Daylight Time, UTC-04:00)  #    
# Friday, 06 June 2008

In addition to the talks with C++ in the title (3 of them) and with C++ or a related word in the abstract (3 more) I listed in an earlier posting, I spotted this in a Tech Ed deck:

Heh. That sure isn't C#. What talk is it?

MBL302 Building Windows Mobile Applications That Work with Windows Vista Sync Center

The new Sync Center in Windows Vista will become the hub for all data synchronization between the PC, Mobile Devices, and online services. Take a closer look at the development framework, as well as the end-user experience that Sync Center helps create. This session dives into the code you need to write in order to plug your application into the Sync Center user interface. If you're writing an application for Windows today that has any synchronization components, you should not miss this session.
 
The speaker has a blog entry that states his pro-C++, pro-COM position unambiguously:
This is easy, this is Windows software development like it has been for at least 10 years. It is well defined, well known and well supported...go and learn C++ and COM, it is how many of the Windows Vista features are exposed to developers and with good reason. If you are not prepared to learn how to program your computer then you should question why you are in the software development business.
I think easy might be an overstatement, but I do certainly agree that "old style" programming techniques still have real value in the Vista universe. Keep your skills sharp!
 
Kate
 
Friday, 06 June 2008 09:20:52 (Eastern Daylight Time, UTC-04:00)  #    
# Monday, 02 June 2008

I've been talking with attendees already and thought I would share some ideas I've been passing along. Planning is key to getting the most out of this week. The last thing you want is to be wandering the endless halls of a huge convention centre wondering where you should go next.

Start by planning your sessions with the schedule builder. You should put at least two sessions into almost every slot. Here's why: some of the sessions you plan to go to will not be right for you. They will be too introductory, or too advanced. They will cover just one little part of a technology that you don't know enough about, or a giant overview when you've already decided to concentrate on one corner. This should be clear about 5 minutes into the talk, and then what you need to do is leave. The slides will be on CommNet or the attendee DVDs, so you can get your overview or introduction later. But this hour of your life spent in the same room with someone who knows the topic needs to be spent carefully. So you quietly leave, and head to the other session you planned for this time slot. There really isn't time for you to start flipping through the catalog for possibilities once you've already ducked out. On the other hand, if the session you chose is amazingly great, stay, and plan to get the slides for the other talk instead.

As the week goes on, you'll learn the leveling codes. Every session has a code like TLA326 (my Tuesday afternoon talk.) TLA means Tools and Languages, which is appropriate since my talk is about MFC updates the team has just delivered. the "26" part doesn't really mean anything, it's just an identifier, but the 3 is the most important part of the session code. It means this is a 300 talk. These talks are advanced level, for experienced developers. They are supposed to include:

  • Drilling into how a Product / Technology is designed 
  • Real world examples
  • Complex coding, known issues and workarounds (sample code/examples)

Compare that to a 400 level talk (like my TLA403 late Friday.) These are expert level, and likely to have:

  • Advanced coding considerations/challenges
  • Design considerations/challenges
  • Architecture considerations/challenges
  • Troubleshooting techniques at the debug level

The best description I've heard is that a 400 level talk will make your head hurt, in a good way. But really you just have to start attending talks and then you will start to see the difference. You will also start to recognize key phrases in talk titles and abstracts such as A Lap Around and know what to expect from that session.

The next tip is that sooner or later you will have a timeslot with no sessions. Maybe you ducked out of one, and then ducked out of your second choice too. That's OK! Head down to the lowest level and wander by the product team booths in the TLC, or the Community Lounge, or do a Hands On Lab. These things are often the most important part of Tech Ed. More on that later!

Kate

Monday, 02 June 2008 10:48:37 (Eastern Daylight Time, UTC-04:00)  #    
# Sunday, 01 June 2008

Here I am again in Orlando, getting ready for another Tech Ed.

Being in a familiar place, doing something I've done so many times before, it makes me finally ready to blog again. A lovely quote I read just yesterday, "Blogging, like speaking at a Quaker meeting, is something one must do only if the spirit moves one." And today, in a hushed convention centre that will hold over 10,000 tomorrow but seems to have only a dozen today, it moves me. (Read the whole article, btw. And reflect that at Tech Ed we are exhorted to Learn, Connect, Explore.)

Tomorrow, my precon on Vista programming. And plenty more to follow. My friends, in more ways than one, here we are again.

Kate

 

Sunday, 01 June 2008 16:05:46 (Eastern Daylight Time, UTC-04:00)  #    
# Wednesday, 30 January 2008

Daniel Moth alerts us that a new icon has been added to System.Drawing.SystemIcons in SP1 of the .NET Framework 2.0. It's the shield - the one you put on a button by sending a BCM_SETSHIELD message with true as a parameter. Now there's another way to put the shield on things and alert people that what they are about to do will trigger a UAC prompt. Cool!

Kate

Wednesday, 30 January 2008 12:00:44 (Eastern Standard Time, UTC-05:00)  #    
# Monday, 28 January 2008

This year for the first time I am speaking at SD West. This is a conference I have watched from afar and often wanted to attend. I’m delivering a half day tutorial on Vista Programming, and a new breakout session called Practical Visual Studio Team Systems.  In between I will be at Sutter and Stroustrup on C++ and a host of other feed-my-brain sessions that you might also want to attend. Check the full session list and register quickly... the early bird deadline is February 8th.


The Vista Programming abstract is:

Windows Vista is the most compelling operating system release in nearly a decade. With major improvements in the areas of security, user experience, and performance, Windows Vista offers a robust and dependable platform for building a breadth of solutions. This half day seminar prepares you for building a new class of applications that take advantage of these improvements. Come and see how to take advantage of some of the most interesting new native APIs, inter-op techniques, and .NET Framework 3.0 technologies. Learn how to build the next generation of smart client applications with the Windows Presentation Foundation (WPF), and improve user experiences with technologies like task-based dialogs, sidebar gadgets and customized Windows search functionality. Learn inter-operability techniques with managed wrappers and how to leverage the Vista Bridge. Dive into the best practices for upgrading existing applications, and understanding User Access Control (UAC). Learn how to build more reliable and secure applications with technologies like Application Restart/Recovery. And lastly, learn how to build more connected systems with Windows Communication Foundation (WCF) and RSS platform support.

The Team Systems abstract is:

The real strength of VSTS is its adaptability. Our small shop (no professional project managers, everyone’s a developer of some kind, not-officially-agile-but-not-CMMI-either) has learned a lot about making VSTS and TFS fit the way that we work. Topics include knowing which project people are working on without asking them, adding your own fields to those provided out of the box, writing your own queries and reports, and customizing your project portal. This session will help you get up to speed with the features the most practical features VSTS has to offer, and best practices will be suggested.

See you there!

Kate

Monday, 28 January 2008 11:48:43 (Eastern Standard Time, UTC-05:00)  #    
# Sunday, 27 January 2008

Tech Ed breakout selections are almost complete, and I should have an announcement soon about my Tech Ed presence. We can get started with my PreCon:  Windows Vista Programming: User Experience, Application Compatibility, Reliability and Connections. The pre cons are on Monday of Tech Ed week this year, and registration should open soon. In the meantime, plan to travel Sunday  night and attend this pre con so you can come up to speed on programming for Vista and with .NET 3.5 including WCF and WPF.

Kate

Sunday, 27 January 2008 11:45:43 (Eastern Standard Time, UTC-05:00)  #    
# Saturday, 26 January 2008

A little while ago I appeared on GeekSpeak, talking about the Vista Bridge and how managed code developers (C# and VB.NET, for the most part) can get to some of the cool new Vista stuff without having to get into the worlds of C++/CLI or of interop. I love those worlds but I understand plenty of people don’t. The recording is now on Channel 9. Geekspeak is an unusual webcast because there’s no powerpoint, and no agenda. You show up, people ask you things, you talk, you demo, and before you know it an hour has gone by. I had a great time and I hope you enjoy it too.

Kate

Saturday, 26 January 2008 11:44:36 (Eastern Standard Time, UTC-05:00)  #    
# Thursday, 24 January 2008

I don’t like this. Really, I don’t. But there are people who are turning off UAC on their whole machine because there is one application for which it is a deal killer. So, reluctantly, I will tell you how to turn off UAC for just one application. I would rather you didn’t do this. Please, have a good reason.

And remember, UAC applies only to interactive applications. If it was a service, it wouldn’t be affected by UAC. So that whole tale of woe about nobody is at the keyboard to consent to the prompts? Then why not make it a service? Honestly, that would be better. Let this just be a stopgap. OK?

Kate

Thursday, 24 January 2008 11:40:22 (Eastern Standard Time, UTC-05:00)  #    
# Wednesday, 23 January 2008

When .NET first burst on the scene, we talked a lot about “XCopy deployment”. What we meant was that you didn’t need registry entries, you didn’t need to copy DLLs to windows\system32 or whatever, you didn’t need to mess around with the person’s computer hardly at all – you just copied the exe and dlls into some folder somewhere, optionally a foo.exe.config into the same folder, and you were good to go. But we really should have called it “FTP deployment” because people would come up to me at the end of talks and ask where to find the XCopy utility that you needed to deploy .NET applications. Ooops.
For those who never knew it, XCopy was a command (extended copy, a replacement for the original copy) that came with DOS. It was so much better than copy because, among other things, if the target floppy drive was full when you were copying a whole pile of files, it would prompt you to put in another one and keep going, where ordinary copy would go “disk full” and abandon the whole thing.

I admit, it’s been well over a decade since that’s been an issue, so it perhaps was no surprise to read that XCopy has gone the way of all utilities ... replaced by something shinier that has less compatibility issues with the new operating system. Of course it isn’t exactly gone, just deprecated. OK. I might have to learn Robocopy now. But I promise never to speak of Robocopy deployment. That just sounds weird.

Kate

Wednesday, 23 January 2008 11:38:41 (Eastern Standard Time, UTC-05:00)  #    
# Thursday, 13 December 2007

In Barcelona I was lucky enough to meet Lynn Langit who told me about a number of important initiatives she's working on. I mean how can you resist "we're saving lives with Visual Studio Team Systems" as an elevator pitch? She means it, too. Lynn also does geekSpeak webcasts - no slides, no detailed agenda, just show the people something, wait for a question, show them the answer to the question, repeat for an hour. It sounds like terrific fun and I watched a few to make sure it would be, then I said yes, I would do one.

MSDN Webcast: MSDN geekSpeak: The Windows Vista Bridge for .NET Programmers (Level 300) 

Event ID: 1032362711

Language(s): English.
Product(s): .NET.
Audience(s): Developer.
Duration: 60 Minutes
Start Date:
Wednesday, January 16, 2008 12:00 PM Pacific Time (US & Canada)

Event Overview

In this installment of geekSpeak, Kate Gregory, C++ expert, unravels the mystery of the "Windows Vista Bridge." This webcast has little or no C++ content and is aimed at Microsoft Visual Basic and Visual C# programmers who want to access cool Windows Vista stuff without the C++/CLI approach. If you have a question or comment you would like us to address during the webcast, visit the geekSpeak blog and submit it now.

Presenters: Kate Gregory, Regional Director, Gregory Consulting

Register now! Ask questions in advance on the geekSpeak blog!

Kate

Thursday, 13 December 2007 09:01:01 (Eastern Standard Time, UTC-05:00)  #    
# Sunday, 09 December 2007

On Tuesday, December 11th, I’ll be presenting Developing as a Non-Admin in the Ignite Your Coding series of webcasts. I’ll be showing Visual Studio 2008 and Vista and my focus will be on understanding the UAC consent dialogs, and how to keep your application from needing them. Register for it now, or later use the same link to come back and view the recording. But if you attend live, you can ask questions, and that’s often the best part of a webcast.

Kate

Sunday, 09 December 2007 16:19:29 (Eastern Standard Time, UTC-05:00)  #    
# Thursday, 06 December 2007

Here’s a little video I did with Paul Foster on C++ and Vista topics. 15 MB, 2.5 minutes. Short but sweet!

Kate

Thursday, 06 December 2007 16:14:03 (Eastern Standard Time, UTC-05:00)  #    
# Sunday, 05 August 2007

I am generally loving Vista and have no intention of going back. I keep a few VPCs of older OS'es around, for various reasons, and some of the machines in my firm haven't been updated, mostly single-purposes boxes like a file-and-print server that isn't hurting anyone, or a machine dedicated to running our accounting software. But I won't pretend there haven't been annoyances - there have. And one of them has been opening a folder full of files and getting these weird columns like Date Taken and rating and the like:

Scott Hanselman showed me how to fix it. Do this in the root of C if you like, and apply to all subfolders. I have a "working" folder, with subfolders under it for each client, and I did it there. Aaaah, relief.

Kate

ps: Still filing Scott under RD for a little while until the assimilation takes full effect :-)

Sunday, 05 August 2007 08:06:07 (Eastern Daylight Time, UTC-04:00)  #    
# Monday, 30 July 2007

Long Zheng has a lot of Microsoft-watching going on. This image comes from a slide he highlighted from Steve Ballmer's presentation for FAM (I already highlighted Craig Mundie's comments to the same audience.)

The comments are interesting too. Read the post.

Kate

Monday, 30 July 2007 17:05:30 (Eastern Daylight Time, UTC-04:00)  #    
# Wednesday, 25 July 2007

Hey, this is fun! Want to write an application? In C++? For Vista?

Maybe it should have a split button:

Or a drop down with a cue banner:

Or ... well how about you read the article? It's by Kenny Kerr. It's the start of a new column for him -- look for it every other month in MSDN Magazine.

Kate

Wednesday, 25 July 2007 21:11:34 (Eastern Daylight Time, UTC-04:00)  #    
# Friday, 20 July 2007

Recently I told you how to get a virtual image of Vista for evaluation purposes. Now you can try a variety of operating systems, applications and server products, preinstalled onto evaluation VHDs. Try Vista, Office 2007, Visual Studio Team System, SQL Server 2005, Office Sharepoint Server 2007, and more. Some of these products are a little tricky to get installed and ready to go, so a virtual image is just what you need. Even if you have an MSDN subscription, you might like to use these VHDs just for that convenience factor.

http://www.microsoft.com/technet/try/vhd/default.mspx

Kate

Friday, 20 July 2007 19:46:05 (Eastern Daylight Time, UTC-04:00)  #    
# Tuesday, 17 July 2007

So you were thinking about entering the Gadget contest, but then you didn't get around to it? Well lucky you, you get another chance. Here's what I heard today: the deadline has been extended a month. You have to get your gadget into the Gallery to enter, and it's a process with a few steps to it:

Process to Enter Competition

 

Developers will need to perform the following actions:

 

1.       Post their Gadget on the Windows Live Gallery (approval process can take a few days)

2.       Return to the Gadget Vs. Gadget site and select ‘Enter Contest’ tab and use their Live ID to login

3.       Complete the entry form to submit their Windows Vista gadget for review

 

Winners will be announced September 4, 2007.

Same cool prizes, same great exposure, so go for it! http://www.microsoft.com/canada/msdn/gadgetvsgadget/default.aspx . Remember, Canadians only!

Kate

Tuesday, 17 July 2007 16:38:39 (Eastern Daylight Time, UTC-04:00)  #    
# Saturday, 14 July 2007

This is actually something that got settled during Tech Ed USA but my June schedule meant a lot of things I intended to blog didn't get blogged. Now I see myself listed on the Featured Speakers page (I told them, "flattery will get you everywhere" and they're going for it) so it's official.

My talks? The C++/Vista talk I did in the USA, plus a managed-code Vista one. We're still working on an abstract for that.

This will be my third trip to Barcelona. Will this be the year I do the Gaudi-tourist thing? Sure hope so!

Kate

Saturday, 14 July 2007 15:43:33 (Eastern Daylight Time, UTC-04:00)  #    
# Thursday, 21 June 2007

Here is something really cool. If you happen to hold Shift while you right-click a file in Windows Explorer, you get more options on the menu:

   

The one I'm most likely to use is Copy as Path. Lets say you've just put a file on some shared drive somewhere and now you're emailing someone that you've done so, or you're passing the full file name to another application, or you're recording the file name in the files itself so that printed copies make sense. You need to copy the path from the address box, then the file name - it's annoying. This little trick doesn't save a ton of keystrokes, but I like it.

Kate

Thursday, 21 June 2007 18:25:11 (Eastern Daylight Time, UTC-04:00)  #    
# Monday, 18 June 2007

Here is a neat thing i actually learned about from people complaining about Vista performance. I haven't been having performance problems to speak of (except for that darned copying thing) but I was intrigued to hear about a background process that keeps track of how stable your system is. The Reliability and Performance Monitor is tucked away under a zillion menu options (this blog post leads you there) but I just click the marble and type reli and there it is:

The first thing you get is a performance monitor-type view, to do with as you will:

But if you click reliability monitor, you get something really quite new:

Here you see things the system feels were instabilities in my system in late May and early June.  Mind you, it has a very persnickety bar when it comes to those red Xs.

On June 1st, Visual Studio blew up on me. I bet I know what that was, too -- from time to time it blows up when I drop down a list of methods in those bars across the top of the code editor, especially if I try to scroll in the dropdown -- and not only was that recorded, but it contributed to a lower "stability index" for the day. As you can see, the system also records everything I installed (including updates through Windows Update) and everything that failed. It's a pretty neat way to remind yourself what you've been going through. You can also validate wild claims like "Project blows up at least once a week" by scrolling back and counting them. Ah, evidence :-)

Kate

Monday, 18 June 2007 13:28:42 (Eastern Daylight Time, UTC-04:00)  #    
# Thursday, 14 June 2007

Have you tried writing a gadget yet? They're really simple and can have an immediate impact on your productivity. If you're a Canadian adult, you can enter your gadget into Microsoft Canada's contest and win some serious hardware.

The contest site has plenty of links to get you started and give you some inspiration. You have till July 16th, so get creating!

Kate

Thursday, 14 June 2007 09:19:43 (Eastern Daylight Time, UTC-04:00)  #    
# Monday, 11 June 2007

Recently I had some major issues with a VPC somebody prepared for me. It came from a DVD and I just could not get it to run on Vista, though it ran great on XP. I was fairly sure that it would run OK if I could just launch VPC elevated and then open the .vmc file, but when I launched VPC (elevated or not) the only evidence of its existence was a taskbar entry (there was no window to be seen) and even that disappeared if I right-clicked on it.

I solved the first problem by granting Users access to the .vmc and .vhd files (I went with Full Control since I had them on a non-shared drive) and then the VPC ran perfectly. That was a better fix than elevating VPC every time anyway. But along the way I discovered how to fix the disappearing console. This post by Steve at EssJae.com shows what you need to do: find the options.xml file in C:\Users\%current_user%\AppData\Roaming\Microsoft\Virtual PC and open it -- make sure the console is not up and you're not running a VPC. Scroll down and find the <console> section  and you will see some very large numbers for left_position and top_position. Change them to something normal, like 10 or 100, and save the file and you'll be back in business.

Kate

 

Monday, 11 June 2007 15:59:03 (Eastern Daylight Time, UTC-04:00)  #    
# Thursday, 07 June 2007

I have spoken a LOT (too many times to link back) over the last year or more about getting your applications to work on Vista. When I ask for a show of hands to see who has tested their apps on Vista, I typically get less than a quarter of the room. When I ask why I hear things like "a copy of Ultimate is too expensive just to test with" or "I don't have a spare machine with the horsepower to run Glass" or even "I don't have a spare machine".

Fear not. How about a FREE evaluation VHD image of Vista, that you can run with the FREE copy of Virtual PC on the machine you have now? It might be slow, it might not do Glass, but you can find out for FREE if your app even runs, if it works under UAC, what happens if you put a manifest on it, and so on. Come on, what's stopping you? Jean-Luc David of Microsoft Canada has all the links for you.

Kate

Thursday, 07 June 2007 16:27:04 (Eastern Daylight Time, UTC-04:00)  #    
# Tuesday, 05 June 2007

My Tech Ed USA talk this year was "Vista and C++/CLI - a Natural Fit". A lot of Vista goodness is hard to get to from managed code. In the precon I showed you how leveraging other people's work (specifically the Vista Bridge and the Preview Handler Framework Stephen Toub wrote for MSDN Magazine) can eliminate some of that difficulty. In my C++ talk I drilled a little further, into things like property handlers that can only be in native code (same for thumbnail providers though I didn't show one) and flukes of the IDE that (for Visual Studio 2005 anyway) make adding a UAC manifest easier for C++ developers. The slides should be on CommNet for registered attendees, and if you want the code samples you can drop me a line. The property handler sample is straight out of the SDK so I don't need to send you that.

Kate

 

Tuesday, 05 June 2007 16:11:58 (Eastern Daylight Time, UTC-04:00)  #    
# Monday, 04 June 2007

Here are the slides (5 meg) from the precon I did on Vista Programming with Tim yesterday. I've only zipped up "my" decks -- Tim should be posting his soon. If you attended and want my code, please drop me an email and ask for the demo that you want. Oh and please do your evals ... we don't have as many evals as attendees right now and trust me, evals make a difference so if you enjoyed the day, tell Microsoft so, and if there's something we could have done better please make a detailed comment - I read them!

Kate

PS to the attendee who gave us "1" on every question but said our demos were effective and the technical level was just right, did you know that 1 means the absolutely worst experience you have ever had? 9 means terrifically great.

Monday, 04 June 2007 09:41:27 (Eastern Daylight Time, UTC-04:00)  #    
# Sunday, 03 June 2007

I am very much a keyboard person. Why would I mouse all the way over to something when I can Ctrl-S or Alt-Tab or Windows-D to get what I want? This entry on the Vista team blog lists a few, and the comments list plenty more. Windows-space was new to me. Perhaps you'll find a few goodies too.

Kate

Sunday, 03 June 2007 09:27:08 (Eastern Daylight Time, UTC-04:00)  #    
# Thursday, 31 May 2007

It's time to get serious about planning my Tech Ed time next week. So far I have these immovable rocks, some of which I hope will be a don't-miss for you too:

I will be spending time at the RD Booth too so if you miss me at one of my sessions, look for me there! I'm hoping to have a fantastic week meeting developers and talking about Vista, C++, and interop in my real world and in yours. I'm also hoping to stay INDOORS as much as I can. Here at home it's in the high 20s even low 30s (Celsius, in other words HOT) but the humidity is nice and low. I know that's not what I'll find once I get to Orlando.

Kate

Thursday, 31 May 2007 11:52:54 (Eastern Daylight Time, UTC-04:00)  #    
# Wednesday, 30 May 2007

Again a blogging pause. Just too darn much work and a fair amount of speaking too. I'll do some "what's upcoming" shortly, but first here are the materials from my talk at the Toronto .NET User Group this week. I helped to found this group five years ago and it was great to be back. I've been doing this Vista talk a lot lately (Code Camp, DevTeach, a webcast last week, and now in Toronto) and it seems like people keep wanting to hear it. It's hard to fit it in a single evening but yes, you can learn what you need to get your app working on Vista in just an hour or two.

The first demo - the one app that has a manifest for the whole thing. Play with the required level or take the manifest away (remove the post build step) to see virtualization. UACDemoSolution1.zip (68.65 KB)

The second demo - the partitioned app with an asInvoker manifest for the overall app and a requireAdministrator manifest for the privileged exe. Also shows how to put the shield on the button. UACDemoSolution2.zip (68.2 KB)

Some fun with the Vista look and the effort VistaBridge saves. CommonFileDialogSolution.zip (1.88 MB)

The deck. ItsVistaTime.zip (790.18 KB) Zipped because the four digit extension seems to be causing a problem. It's .pptx which means you need the viewer for it.

More in the days to come!

Kate

Wednesday, 30 May 2007 23:49:16 (Eastern Daylight Time, UTC-04:00)  #    
# Friday, 30 March 2007

About six months ago, I posted a few UAC screen shots and compared the text on them, the icons (the four colour shield vs a shield with a big exclamation mark) and the colours of the area where the title appears. Now Raymond Chen summarizes those four colours for people who have trouble remembering them.

The more you understand what UAC is saying, the less frustrating you will find it.

Kate

Friday, 30 March 2007 12:09:45 (Eastern Standard Time, UTC-05:00)  #    
# Saturday, 24 March 2007

Oh yes! I have been waiting for the marshaling library for ages! And I just pointed to a VC++ team post about the common controls changes for MFC. Here's the marshaling library in a nutshell:

Back and forth between all the different kinds of strings, various managed and unmanaged types, all the stuff about where things are allocated and how they are freed ... it's usually just 4 or 5 lines of code each time but it's gross and you have to look it up every time. Now these templates will take care of it for you. Beautiful! And on top of that, it's sometimes even faster than doing it yourself the old way!

And check this out, all those who are allergic to angle brackets:

Watch the whole video, of course. Go, Sarita!

Kate

Saturday, 24 March 2007 11:54:14 (Eastern Standard Time, UTC-05:00)  #    
# Thursday, 22 March 2007

The Visual C++ team has an update for you about their Orcas plans around MFC and the Common Controls in Vista. There are a lot of new APIs in Vista compared to XP, but just as important there are new styles (like the style that makes a button a CommandLink) and messages (like the message to a button that tells it to draw itself with a security shield.) Right now to work with these new "thingies" (my technical term for them) you need to send Windows messages. In Orcas there will be design time support for all this and more. Even the new Common File Dialogs will be yours as if by magic.

Looking forward to it!

Kate

 

Thursday, 22 March 2007 11:41:17 (Eastern Standard Time, UTC-05:00)  #    
# Wednesday, 21 March 2007

I have such a good time when I do .NET Rocks with Carl and Richard! I'm sitting around chatting with my buds, doing a little shop talk, sharing horror stories -- the time flies by. I hope one or two of you enjoy listening to it, too. Some things I heard myself say that sound pretty funny now:

  • you're out of feet, i'm taking over
  • it's the speed of light -- we're screwed

That first one is the CLR talking to people who messed up constantly on memory management. The second is of course the concurrency story. Along the way we talked about Vista (a lot) and covered plenty of ground. Why not give it a listen?

Kate

 

C++ | Concurrency | RD | Speaking | Vista
Wednesday, 21 March 2007 11:39:22 (Eastern Standard Time, UTC-05:00)  #    
# Saturday, 17 March 2007

It's a strange thing about debugging under Vista that the one thing you really don't want to do is press F5. It's rather a long story as to why, but it's a good habit to go and find your executable and double-click it. And if you develop that habit, you may find that getting Visual Studio to build you a release or a debug version is not that simple. (Pressing F5 builds a debug version, and Ctrl-F5 builds a release version, before launching the application.) For many people, the dropdown that shows what configuration you're building has disappeared from the toolbar where it belongs. And even if you're brave enough to wade into the Customize dialog and put it back, it's disabled:

To get things back the way they once were, bring up Tools, Options, and go to the General section under Projects and Solutions. Find "Show advanced build configurations" and check it.

Presto! Debug is back!

Not what I'd call discoverable, so spread the word.

Kate

Saturday, 17 March 2007 11:04:55 (Eastern Standard Time, UTC-05:00)  #    
# Friday, 16 March 2007

It's interesting when we measure new things using old rules. A number of people have observed that Vista machines doing nothing seem to be using a lot of memory to achieve that nothingness. Words like "bloat" get bandied around. Empty memory is seen as more virtuous than filled memory. I'm not going to link to all the "Vista is using all my memory it sucks" complaints. Instead, I'm going to point you to Jeff Atwood, who explains the whole thing quite nicely and concludes:

The question shouldn't be "Why does Vista use all my memory?", but "Why the heck did previous versions of Windows use my memory so ineffectively?"

Good point.

Kate

Friday, 16 March 2007 10:52:55 (Eastern Standard Time, UTC-05:00)  #    
# Monday, 12 March 2007

Jesper is The Guy on security and since UAC is generally represented as a security feature, I'm interested in just about anything he has to say on the topic. So imagine my eyebrows headed for the ceiling when I read:

UAC does not, nor is it intended to, stop malware.

But my eyebrows came back down pretty quickly. There's a difference between stopping malware and reducing the effect of malware people happen to launch. UAC is intended, Jesper says, to "enable more users to run as a standard user." After all, most devs are admins on their own box, because otherwise they can't accomplish all kinds of day-to-day developer tasks. And then they accidentally write applications that only work if you're an administrator. And most folks react to that by making everyone an administrator. And that leaves you in a nasty place if you did happen to launch some malware. He goes on to say:

...we ideally end up in a situation where most people do not run as administrators and, hopefully, start questioning some of the elevation prompts they do get. The fewer they get, the more likely they are to consider them carefully before allowing them, or so the theory goes. By extension, yes, there may be less malware, but it all depends on (a) whether users keep UAC on, (b) which is dependent on whether ISVs will write software that works with it, and (c) users stop considering prompts to be fast-clicking exercises and actually consider whether an elevation request is legitimate or not.

That last one I am seeing no signs of. A UAC prompt comes up, people just click it as quick as they can. Sigh. Let's hope that changes over time. One last quote from Jesper:

The fact that UAC does not mitigate all security problems, or that it does not possess a property that many of us, myself included, would dearly like to have - first-order protection against malware - does not mean it is not a security technology.

The more we understand the point of UAC, the more likely we are to think a little during that black-screen-pause while the prompt is coming up. If you don't think what you just did deserves a UAC prompt, why are you going to consent?

Kate

Monday, 12 March 2007 22:48:33 (Eastern Standard Time, UTC-05:00)  #    
# Wednesday, 07 March 2007

I know I mentioned earlier about Code Camp (March 31st, downtown Toronto). The sessions are now set and there will be five tracks with five talks each. Topics range widely - SharePoint development, fundamentals of generics, game programming with XNA, workflow, even a robotics / mobility mashup! Plenty of veteran and new speakers; it promises to be a great day. My talk is scheduled early so I can relax and watch everyone else after I'm done. In keeping with my Code Camp tradition this will not be a C++ talk - I'll be covering Vista programming for non C++ people.

Kate

MVP | RD | Speaking | Vista
Wednesday, 07 March 2007 08:54:02 (Eastern Standard Time, UTC-05:00)  #    
# Tuesday, 06 March 2007

Hey, this is great, my Tech Ed talk was accepted this year. This is the earliest I've known I'll be speaking at Tech Ed USA. (I know, I already knew I was headed there for the pre-con, but now I have a breakout.)

C++/CLI and Vista: a natural fit

Vista brings a host of new features that developers can use to create beautiful, powerful, and intuitive applications. Some of these features are easy to access from managed code while others are more of a challenge. These features are generally easy to access from native code. By using C++/CLI, a developer can call either native or managed APIs with maximum ease. This session will demonstrate a variety of different Vista features to illustrate the strengths of C++/CLI.

This should be a level 300 talk and I'm really looking forward to it!

Kate

Tuesday, 06 March 2007 08:45:39 (Eastern Standard Time, UTC-05:00)  #    
# Monday, 05 March 2007

A lot of the Vista PR focuses on what it's like to use Vista. Let's say you're deciding whether to make your application run well on Vista. What's in it for you? Is it just about "10% of my customers are on Vista already, so I'd better support them" or is there more? Vista actually offers you goodies as a developer, above and beyond the .NET Framework 3.0. In this latest Channel 9 video, Michael Wallent talks about shiny new WPF applications, but also about reliability, restart and recovery, why your application will perform better on Vista, and much more. I love watching people care about their work, especially when there's so obviously a huge pool of technical knowledge behind what they're saying. This is a great video. and not just because of the turn the conversation takes at about 18 minutes.

Kate

Monday, 05 March 2007 08:39:58 (Eastern Standard Time, UTC-05:00)  #    
# Sunday, 18 February 2007

I will be in Montreal in May to speak at DevTeach.

My talk:

It’s Vista time – is your application ready?

Windows Vista provides an extensive set of new APIs that enable improved user experiences and enhanced security, but some of these APIs are exposed through native COM and Win32 programming models. This session highlights strategies and techniques for taking advantage of these native APIs from managed code. Learn what's really involved in making your .NET application "light up on Windows Vista" with User Account Control (UAC) integration, Windows Vista User Experience features like common file dialogs, task dialogs and command links, and integrated desktop search.

DevTeach is a lot easier to get to than some of the bigger conferences, and it has a star-studded speaker list. See you there!

Kate

Sunday, 18 February 2007 15:35:55 (Eastern Standard Time, UTC-05:00)  #    
# Friday, 16 February 2007

That Mac ad where the PC is going for "surgery" so he can upgrade to Vista really ticks me off. First, I upgraded a truly ancient Toshiba to Vista just fine. And second, way to make a bug a feature and a feature a bug! Ha ha when I need a new OS I just throw myself in the garbage and someone buys a new machine! That's so much better than replacing one card or switching to a bigger hard drive! Whatever.

That said, I know plenty of geeks are going to use Vista as an excuse for a new laptop. I'm one of those geeks and I'm about ready to get a new machine. One of the things that's held me back is the thought of the time and trouble to get everything set up my way. You know, my wallpaper, my favourites, my files of course, folder settings, there's so much. Applications don't worry me so much because half the stuff I have installed on here should really go, I don't use it any more. Half the rest came from my MSDN disks and I know where to find those. What's left (WinZip, a really old Paint Shop Pro that doesn't try to do anything fancy, miscellaneous games and utilities) I can install from the \install folder on one of my two main file servers.

And now for the settings, here's something that will make it much less painful: Windows Easy Transfer. Put the old and new machines on your network, and:

This wizard is built into Windows Vista and will automatically transfer your personal data from a Windows 2000, Windows XP, or Windows Vista based-PC to a Windows Vista-based PC.  It gathers up the data from your old PC and then applies it on your new PC in the right places.  It will move user accounts, files and folders, email messages and settings, address book entries, and Windows settings.  It does not move programs.

No network? (Helping your family, and they don't have a network onaccounta they only have one machine?) Use a special cable to connect the two machines. There's even an option involving removable hard drives or burning to disk that sounds like it might work if you have only one machine but are repaving. (Sounds a might scary to me, but ok.)

Plus, there's a tool in beta that moves your apps too:

we have been working on a new tool called Easy Transfer Companion, which will transfer programs and program settings from a Windows XP-based PC to a Windows Vista-based PC.  When used together with Easy Transfer, you will be able to move everything you need to your new PC running Windows Vista.  Easy Transfer Companion has been designed to transfer many of the most popular programs for consumers and small businesses, as well as many others.  You can transfer programs with either an Easy Transfer Cable or a network.  We've released the tool in Beta so that we can take feedback on the overall functionality and get more information about the experience of transferring specific applications outside of those that we've tested internally.

Now I just have to choose a shiny new laptop...

Kate

Friday, 16 February 2007 14:56:32 (Eastern Standard Time, UTC-05:00)  #    
# Tuesday, 06 February 2007

I missed this article when it first appeared. Mary Jo Foley talked to Jason McConnell, me, and David Johnson about getting to all the new exciting Vista goodies, and how it's a bit easier from C++ because you can mix and match native and managed so simply. Watch for more guidance and guidelines on this from Microsoft coming soon.

Kate

Tuesday, 06 February 2007 10:33:14 (Eastern Standard Time, UTC-05:00)  #    
# Saturday, 03 February 2007

This year I will be partnering with my friend Tim Huckaby to deliver a pre-conference session at Tech Ed USA 2007 in Orlando:

PRCN12 From Design to Deployment: Everything You Need to Know to Optimize Your Applications for Windows Vista 
Kate Gregory and Tim Huckaby
Windows Vista is the most compelling operating system release in nearly a decade. With major improvements in the areas of security, user experience, and performance, Windows Vista offers a robust and dependable platform for building a breadth of solutions. This full day seminar prepares you for building a new class of applications that take advantage of these improvements. Come and see how to take advantage of some of the most interesting new native APIs, inter-op techniques, and .NET Framework 3.0 technologies.

In this all-day pre-conference seminar, learn how to build the next generation of smart client applications with the Windows Presentation Foundation (WPF). Learn the fundamentals of WPF and work your way through advanced topics like 3D. Learn how to build great user experiences with technologies like task-based dialogs, sidebar gadgets and customized Windows search functionality. Learn inter-operability techniques with managed wrappers and how to leverage the Vista Bridge. Dive into the best practices for upgrading existing applications, leveraging User Access Control (UAC) and techniques for virtualization. Learn how to build more reliable and secure applications with technologies like Windows Error Reporting, Next Generation Cryptography and Application Restart/Recovery. And lastly, learn how to build more connected systems with Windows Communication Foundation (WCF) and RSS platform support.

Many Tech Ed attendees come a day early to do a pre-con and jumpstart themselves to be ready for the rest of the conference. Registration is open and the early bird discount is still in effect.

Other RDs delivering pre-cons include Scott Hanselman, Richard Hundhausen, and Kimberly Tripp along with many other people you have heard of. This is great opportunity to get up to speed on a topic very quickly. You can then go and drill further into some niche of it that interested you, by attending breakouts on that subtopic.

See you there!

Kate

ps: do I have a breakout session? There's no announcement on that yet :-)

RD | Speaking | Vista
Saturday, 03 February 2007 12:26:20 (Eastern Standard Time, UTC-05:00)  #    
# Sunday, 21 January 2007

A lot of people are asking me if I am using Vista, if they should use Vista, if I think Vista will get good adoption, and so on. I have Vista on some machines, still have XP on my ancient primary laptop, and miss Vista when I'm not using it. I tell people this and they assume it's all about the shiny and the seethrough and the pretty. It's really not. For me the fast search is a big thing. And I still consider UAC a feature and have no intention of turning it off or launching everything I do from an elevated command prompt. I like the thumbnails that actually show your content - though I suppose some might dismiss that as "pretty", it's saved me from opening big files with odd names more than once, just so I can tell whether I want to delete them or not. An MSDN article lists a number of useful benefits of running on Vista that have nothing to do with being pretty. Beyond UAC and other security benefits, consider Sleep (fast as Standby, safe as Hibernate), SuperFetch, ReadyBoost, restart manager, presentation mode, ... there's so much! It's not just about the .NET Framework 3.0 -- you can have that downlevel. It really is a new version of the operating system and it does a lot of things a lot better.

So I forgive it for being pretty.

Kate

Sunday, 21 January 2007 17:45:53 (Eastern Standard Time, UTC-05:00)  #    
# Thursday, 18 January 2007

Rory interviews Kam VedBrat about glass, composition, DWM, and other ways to stray from the gray-buttons-and-white-textboxes-on-a-big-gray-background that is the UI most devs naturally create. Watch it!

Kate

Thursday, 18 January 2007 07:32:58 (Eastern Standard Time, UTC-05:00)  #    
# Saturday, 13 January 2007

Jeff Atwood has a fun post explaining how much more quickly he finds things now that he can once again just type the names of programs. It's so true. Instead of clicking Start, All Programs, Microsoft Office, Microsoft Word Whatever, with the attendant pauses while the menus come up and the pauses while I desparately scan the huge list looking for the thing I know has to be there somewhere, it's just press the Windows key and type word, then press enter. Or perhaps type w if I'm lucky enough. The search is blazing fast and there's the application I want, or the file I want, or the control panel sub-thingy that has a new name now so I can't see it. Ah, typing. I never really gave up on typing. And now it's once again one of the main ways we'll interact with the operating system.

And not just because of the way cool search thing. There's the UAC aspect to this too. Open yourself an elevated command prompt, and everything you launch from that command prompt will be elevated -- no manifest, no right-click Run As Administrator, just run your utility so you can do whatever administrative tasks you need to do in relative peace. Small price to pay: you have to type the names of those apps (possibly with their full paths) into the command prompt.

And that's not the only deja vu I get as a Vista user and developer. Does anyone remember making Windows applications before, say WinForms? OK, before VB or before MFC? Before there was a framework that gave you an object called Button that had a property called Text or Caption or the like, how did you set the text on a button? You sent it a Windows message (WM_SETTEXT) with a parameter of "Save" or whatever you wanted.  Well you don't have to do that any longer, but how do you arrange for the shield icon to appear on a button? (It's a convention that if clicking a button is going to pop up an elevation consent dialog, you put the shield on the button.) By sending it a BCM_SETSHIELD message, of course!

The longer you've been programming, the less jarring these things are. Soon enough the tools will catch up and it will be all drag-drop, set properties etc. If that's all you've ever known, you might feel like Vista has dropped you through the looking glass. But if you have some memories of the old days, you're going to be on more solid ground. And you probably still type really fast.

Kate

Saturday, 13 January 2007 21:40:29 (Eastern Standard Time, UTC-05:00)  #    
# Friday, 12 January 2007

Eric Appel recommends installing SP1 for Visual Studio 2005 and the Visual Studio 2005 SP1 Update for Windows Vista Beta. Let's drill into that name a little bit more. Starting at the end, it's a Beta of Visual Studio 2005 SP1 Update for Windows Vista. That is in turn an "Update for Windows Vista" of "Visual Studio 2005 SP1". You have to start with SP1 first. But SP1 has nothing to do with Vista. 

SP1 is a common-or-garden service pack for Visual Studio. It fixes a pile of little things that were found in Visual Studio. Some are just syntax colouring, some are real issues. And it can be argued that you should only install it if you need it. There are some issues with the service pack itself: Heath Stewart has a summary with workarounds where they are known. It can take a long time to install, and you should make sure you have enough disk space, because if the install fails the rollback is a little overenthusiastic ... you might have to reinstall Visual Studio 2005 to make sure certain libraries are in place. That said, lots of people are glad they installed it.

If you want to install the update for Vista, then you need to install SP1. And once you've done that, you'll find many things both simpler and faster. Happy me.

Kate

Friday, 12 January 2007 20:45:47 (Eastern Standard Time, UTC-05:00)  #    
# Thursday, 11 January 2007

Poor Visual Studio 2005, aka Whidbey. Developed and released before Vista, it's Vista-blind. Say you're building a COM component and one of your build steps registers it, writing to something under HKLM. Unless that instance of Visual Studio is running elevated (perhaps because you right-clicked and chose Run As Administrator) the registration will fail. The fix: close Visual Studio, run it again elevated, repeat your build. It's a little frustrating.

Every month that goes by is going to make this better. Eric Appel has a nice summary of what you can do now: install a pair of updates (one released, one in beta) and set Visual Studio to always run elevated. You'll need to consent every time you run it, so I actually skip this, run non-elevated most of the time, and when something fails I close and re-open Visual Studio.  If you would find that super frustrating, go ahead and mark it to require Administrator. It's also a good habit to test by double-clicking your EXE in Windows Explorer rather than hitting F5, so that your app is elevated or not elevated according to its own manifest and not according to the way you started Visual Studio.

It's a transition time. It won't last forever.

Kate

Thursday, 11 January 2007 20:29:05 (Eastern Standard Time, UTC-05:00)  #    
# Wednesday, 10 January 2007

Eric Lee has spotted the Vista-programming-is-easier-with-C++/CLI phenomenon for himself.

... I have really come to enjoy the second incarnation of managed C++, now called C++/CLI. Unless you are really good at .NET marshalling, a lot of great Windows Vista features just aren't that accessible from .NET.  This is where C++/CLI really comes into its own.

He gives a nice example featuring a preview handler. Preview and thumbnail handlers are really cool in Vista, but you have to implement some COM interfaces to do it. His final conclusion:

I'm pretty pleased with how C++/CLI gave me a way to mix what C++ and ATL do pretty well (COM, Shell Extensions, etc) with what .NET does pretty well (user interfaces, dnd design, etc).

Best of both worlds! I have a slide or two that say that :-)

Kate

Wednesday, 10 January 2007 20:21:10 (Eastern Standard Time, UTC-05:00)  #    
# Monday, 08 January 2007

Time for me to speak at my home group once again. Here's the plan:

It’s Vista time – is your application ready?

This session starts with a discussion of overall compatibility of Windows Vista for applications written for earlier versions of Windows OS. It also highlights new features and security tightening in Windows Vista, how applications will behave under these conditions, and what changes may be needed to transition smoothly to Windows Vista.

We then drill deeper into the programming side. Windows Vista provides an extensive set of new APIs that enable improved user experiences and enhanced security, but some of these APIs are exposed through native COM and Win32 programming models. This session highlights strategies and techniques for taking advantage of these native APIs from managed code. Learn what's really involved in making your .NET application "light up on Windows Vista" with User Account Control (UAC) integration, Windows Vista User Experience features like common file dialogs, task dialogs and command links, and integrated desktop search.

Kate Gregory helped to develop the material for the Vista Ascend course for Independent Software Vendors, wrote the Hands On Labs currently being used by Microsoft to teach programming for UAC, and is developing a large C++ Vista reference application. She has spoken on Vista topics on three continents.

The meeting is at the Whitby Public Library. Pizza and networking from 6 to 7, then I'll speak. Please register so we get the right amount of pizza!

Kate

Monday, 08 January 2007 07:19:53 (Eastern Standard Time, UTC-05:00)  #    
# Thursday, 04 January 2007

Ahmed's been running some Touchdown content in South Africa for ISVs who want to certify their applications on Vista. He's collected a nice set of links (about half of them were already purple for me) on the logo programs and things that will help you migrate to Vista. This stuff can be hard to find so having it in one place is very useful.

Kate

Thursday, 04 January 2007 13:20:01 (Eastern Standard Time, UTC-05:00)  #    
# Monday, 01 January 2007

From Ahmed in South Africa:

Bring up the calendar by clicking on the time in the taskbar. Now click on the month (for example December 2006). You will get a year view. Click on the year and you get a ten year view. Click on this and you get a century view.

This is fun!

You can drill back down any time -- just click on a cell and work your way back to the month of interest.

Kate

Monday, 01 January 2007 13:03:37 (Eastern Standard Time, UTC-05:00)  #    
# Monday, 11 December 2006

The Regional Director program truly is worldwide -- about half of the 120 or so of us are located outside the USA. So let's say you want some pictures of Microsoft software in beautiful locations around the world, what better group to ask? The program asked us to send in pictures this fall, and here's the result:


(larger version)

Amazing, aren't we? For my picture, which is nowhere near as spectacular as some, I went and stood among some turning leaves.

Kate

Monday, 11 December 2006 14:01:05 (Eastern Standard Time, UTC-05:00)  #    
# Thursday, 07 December 2006

In Barcelona, I was on the panel for the Barcelona Girl Geek Dinner. Now, lest anyone be under the illusion that these panels are carefully peer-selected and reviewed, that there's some committee somewhere finding the cream of modern geekhood -- well maybe that was how the others were chosen but for me, I was hanging out in the speaker room when Sarah, who I'd only just met, asked me if I'd do it and I said yes.

I had a lovely time at the panel and we all spoke about our experiences, advice to newbies, how nice it is not being "the only one in the room" from time to time, and so on. I was sitting with Catherine and Cyra, two of my fellow panelists, and Charles Torre of Channel 9 was with us, and we talked over dinner and wine the way in my experience geeky women always do -- a fast paced mix of very technical shoptalk and personal getting-to-know-each other material. (I learned a lot from Cyra and wish we had had more time together.) When the event ended, the four of us walked together across the street to the speaker hotel, but it was such a short walk and we weren't finished talking. Someone expressed an interest in dessert, and we decided to see what the lobby bar had to offer. We kept on talking, and at one point Catherine and I were trying to convince Charles that "the compiler is your friend" -- that strong typing and early binding have big advantages. Charles kept saying "I can't believe I'm not filming this" until eventually he picked up the camera and started to film. He asked us questions he knew we cared strongly about and off we went.

The resulting video is now on Channel 9. It seems to kind of start in the middle because, well, we started in the middle. I suspect it's the only video on Channel 9 featuring gestures with a glass of Scotch. It's one of the very few that doesn't feature exclusively Microsoft employees, so I am honoured to see it there. Those of you who have heard my line "I stay up late over too much red wine arguing about deterministic destruction" can now see that in action. We don't introduce ourselves till the very end, so if you need to know who's who, download the whole thing, skip to the end, then go back to the beginning and watch us.

Kate

Thursday, 07 December 2006 10:51:37 (Eastern Standard Time, UTC-05:00)  #    
# Saturday, 02 December 2006

UAC got you all confused? Do you think the best thing to do is turn it off? Maybe this article on TechNet will help a little. It's quite long, and not entirely developer focused, but it's a good place to start understanding what UAC is for and why it would be best not to turn it off.

Kate

Saturday, 02 December 2006 08:26:32 (Eastern Standard Time, UTC-05:00)  #    
# Monday, 27 November 2006

I use search engines for a variety of reasons. Sometimes I want to find out how to do something. Other times, I want to find the official page about something so I can link to it here or send it to someone. Since most of the things I want to learn are related to things I already know, and since I blog about a lot of what I know, I have a bit of an occupational hazard:

One of my mentoring clients complained about this to me. "I decide to search the Internet instead of calling you to ask and what do I find? A bunch of stuff you wrote!". Believe me, it's worse when all I can find is a bunch of stuff I wrote. And Peter Near, a fellow MVP, Flyertalker, and Ontarian, has the same problem.

I would get in the habit of excluding gregcons.com from my search results if not for two things: first, a lot of my stuff is published on other sites, and second, from time to time my old words help me remember something I'd forgotten. So I guess I'm stuck with it.

Kate

Monday, 27 November 2006 07:25:06 (Eastern Standard Time, UTC-05:00)  #    
# Friday, 24 November 2006

There are quite a few products, generally older products, that aren't going to be supported on Vista and probably aren't going to work on Vista. One of the not supported announcements that seems to be catching people by surprise is about SQL Server 2000 and it's free sibling, MSDE. They seem to have run afoul of UAC, which really does require you to change your application.

If you are using SQL Server 2000, you should upgrade to 2005 anyway: it has a lot of improvements for you. But MSDE users don't generally even realize they are using a database: they're using an application that uses a database. Whoever made that application needs to tweak their install so it uses SQL Express (which is just as free as MSDE ever was, and doesn't have a governor) instead. And if that's you, learn about Vista development while you're at it in case your application ends up needing changes too.

Kate

Friday, 24 November 2006 14:24:51 (Eastern Standard Time, UTC-05:00)  #    
# Monday, 20 November 2006

Ed Bott has published some advanced tips for Vista. My favourite? Master the Quick Launch bar, including the Add to Quick Launch context menu item and (I didn't know this) keyboard shortcuts for the items in the Quick Launch. More reasons piling up why I want to move this laptop to Vista ... not much longer!

Kate

Monday, 20 November 2006 12:24:17 (Eastern Standard Time, UTC-05:00)  #    
# Sunday, 19 November 2006

XPS is a new document format. Office 2007 uses it, and your applications can use it too. Under the hood, an XPS document is just a zip file of many XML files and some binary resources (such as images.) The Microsoft XPS page says:

Microsoft has integrated XPS-based technologies into the 2007 Microsoft Office system and the Microsoft Windows Vista operating system, but XPS itself is platform independent, openly published, and available royalty-free. Microsoft is using XPS to bring additional document value to its customers, its partners, and the computing industry.

Since XPS documents describe layout and rendering as well as just content, you can think of them a lot like PDF files. As a result they're likely to show up on web sites or to be emailed to you. If you haven't yet moved up to Vista/Office 2007/IE7 you may not know what to do with them.

The solution is a free XPS viewer. It's up to you whether you want it integrated into IE6 -- I got the standalone viewer from the XPS Essentials. Took only a minute or so to download and install, and I didn't even have to reboot. Get it and be one of the cool kids again.

Kate

Sunday, 19 November 2006 07:58:15 (Eastern Standard Time, UTC-05:00)  #    
# Saturday, 18 November 2006

Microsoft's Developer Division is really taking this transparency thing seriously. First it opened much of the spec for Orcas, the next version of Visual Studio, to the MVPs, and now it's opening it to the public. Seriously! And not only that, but they're asking you how you feel about these features:

Which features do you think are important? Are we making the wrong assumptions about how you will use Visual Studio and .NET? Are we forgetting about your scenario?

This page lists specifications for Visual Studio and .NET "Orcas". These specifications document the new features you will find in CTP's and provide an opportunity for you to give feedback. Please remember, some features specified below may be cut and others may be significantly altered. We'd love your feedback to help us with this decision process. Your feedback will be delivered into our bug database and shared with the feature team. The team will use your feedback to develop the specification or make improvements to future releases of Visual Studio.

So how important is STL/CLR to you? Or friend templates? Read the specs and scenarios, try them out in the September CTP, then speak up!

There are two things you should know about these documents. First, they can be quite large. The STL/CLR one is 38 pages. Second, they're XPS. On my Vista development machine, with IE7 and Office 2007, I just click to read them. On my XP machine with IE6 and Office 2003, it's not so seamless. Time to get me an XPS document viewer for the laptop.

Kate

Saturday, 18 November 2006 07:40:13 (Eastern Standard Time, UTC-05:00)  #    
# Monday, 06 November 2006

Tim Sneath has a neat trick: how to launch something "Run As Administrator" without right-clicking it and selecting from the context menu. And no, I don't mean use the ContextMenu key on your extended keyboard.

"Simply press Ctrl+Shift+Enter from the search bar on the start menu with a selected application, and that triggers elevation."

This is part of a series of useful tips you should probably read.

Kate

Monday, 06 November 2006 07:40:17 (Eastern Standard Time, UTC-05:00)  #    
# Friday, 03 November 2006

I've been using Windows since the beginning. And I use the system icon in the upper left quite a lot, mostly to close things, and especially when the window is off the screen a bit so the X isn't available. In Vista, it looks like that icon/button is gone, but it isn't. Just click where it should be:

Double-click to close the window, or do any of the things you would otherwise do on that menu. Isn't that cool?

Kate

Friday, 03 November 2006 05:52:51 (Eastern Standard Time, UTC-05:00)  #    
# Tuesday, 10 October 2006

Are you ready?

It's time to launch Office, Vista, and Exchange in Canada. Five cities get a large version of the all day event, with business, IT pro and developer tracks, and seven get IT pro and developer talks only. It starts in late November and goes on until January. Registration is free and these things usually full up fast, so register now.

Kate

Tuesday, 10 October 2006 09:05:19 (Eastern Daylight Time, UTC-04:00)  #    
# Saturday, 07 October 2006

Confused about what .NET 3.0 is and is not, and what the next set of libraries after 2.0 will be called? Here's a pretty comprehensive summary from Julie Lerman that lays it out for you.

.NET 3.0 is.NET 2.0 plus the four new components [WPF, Cardspace, WCF, Workflow]. Those four core technologies are called the ".NET 3.0 Components".

The four new components were developed as part of the Vista effort but are so cool that everybody wanted them to be available downlevel, which they are to varying degrees. Julie also gets into Orcas, Atlas/Ajax, LINQ, and what works with what and when (roughly) you'll see it. Check it out.

Kate

Saturday, 07 October 2006 00:36:52 (Eastern Daylight Time, UTC-04:00)  #    
# Thursday, 05 October 2006

Some people are so busy playing UAC-a-mole on their Vista machines that they aren't even looking at the dialogs. In fact these "annoying interruptions" are actually full of information, and it would be a good plan to learn how to read them. In today's installment, I'll show you the results of right-clicking two different shortcuts and choosing Run as Administrator:

See, they're really quite different. The top one is saying "Part of Windows! OK to Trust!" and the bottom one is saying "Stop a minute! Do you really know this app?"

The problem is that most of us are going to read "blah blah blah blah do you want to keep working / playing blah blah blah" and just click Continue without even thinking. That's a shame.

Kate

Thursday, 05 October 2006 16:30:26 (Eastern Daylight Time, UTC-04:00)  #    
# Tuesday, 03 October 2006


Under Vista, an application can have a manifest that identifies the privilege level it needs to run. These manifests can serve other purposes, too: they're also known as fusion manifests and can be used to identify dependencies among other things. Adding one to your application starts with adding a file to your project (right click and choose Add, New Item: depending on the language you're using you might be able to choose XML file or else Text file will do.) Then you put appropriate XML in it, like this:

<?xmlversion="1.0" encoding="utf-8" ?>
<
assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<
assemblyIdentity version="1.0.0.0"
processorArchitecture
="X86"
name
="Sample"
type
="win32" />
<
description>Sample Manifest Test Application</description>
<
trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<
security>
  <requestedPrivileges>
 <!--
<requestedExecutionLevel level="requireAdministrator" /> -->
 
<requestedExecutionLevel level="asInvoker" />
 <!--
<requestedExecutionLevel level="highestAvailable" /> -->
 </requestedPrivileges>
 </security>
 </trustInfo>
</
assembly>

You save the file as ApplicationName.exe.manifest. (When I intend to embed the manifest, I tend to call it app.manifest instead. If you plan to embed it, the filename doesn't really matter, but then if you change your mind and want an external manifest you'll need to remember to rename the file.)

At this point, you can follow the instructions in Catherine Heller's blog. The thing is, when I first read them I thought she skipped a step or something in explaining how to do it with Visual C++ 2005. After all, the other approaches had tons of steps!  There are .rc files, and .res files, and custom build steps, and unloading projects so you can open them differently, and never-mind-the-error-message notes, and all of that. And then for C++ it's just "open the project properties dialog, on the left-hand pane expand the Configuration Properties->Manifest Tool node and select Input and Output. You can enter the name of an external manifest file in the Additional Manifest Files field." But you know what? That's it! You make the manifest, put its name in the dialog, build the project.

Presto, your app has a manifest. Depending on the value you enter for requestedExecutionLevel and the account under which you run the app, you will see different behaviours at runtime.

Kate

Tuesday, 03 October 2006 07:35:51 (Eastern Daylight Time, UTC-04:00)  #    
# Monday, 02 October 2006

I use the Recent Documents list on my Start menu quite a lot. I often work on a number of documents types at once, all from the same folder (organized by project, for example). I open one document that way, but then if I want some other document from that folder, it gets tiring going to Recent Documents all the time. As a result I tend to use Start, Run, and start to type the name of the folder -- since things I typed recently are remembered, it doesn't take many keystrokes:

But now on Vista I have something even easier to deal with. There's an extra choice on the context menu for the Recent documents list:

That's a timesaver for sure!

Kate

Monday, 02 October 2006 18:14:36 (Eastern Daylight Time, UTC-04:00)  #    
# Wednesday, 27 September 2006

The sessions for Tech Ed Africa in Sun City are now available online at http://msevents.microsoft.co.za/teched2006/Sessions.aspx. I have three sessions there, here's how they look:

Notable names on this speaker list:

  • Andre de Beer
  • Ayal Rosenberg
  • Colin Erasmus
  • Dave Webster
  • Hilton Giesenow
  • Jay Schmelzer
  • Ken Everett
  • Kimberly Tripp
  • Ruari Plint
  • Simon Harris
  • Steve Riley

Folks I've seen speak here before, for the most part. This is always a very enjoyable conference for me and I'm looking forward to seeing everyone again.

Kate

 

RD | Speaking | Travel | Vista
Wednesday, 27 September 2006 14:03:28 (Eastern Daylight Time, UTC-04:00)  #    
# Sunday, 17 September 2006

Recently, Jim Allchin (Co-President, Platforms & Services, Microsoft Corporation) posted an open letter to developers. In it he points out that it's one thing to beta test a new operating system (as I and thousands of my closest friends have been doing with Vista) and it's another thing to adapt your applications for a new operating system. For me, there are two important parts to that:

  • What do I have to do to my application to keep it from failing in the new environment?
  • What can I do now to my application so that it will take full advantage of the new environment?

Some Vista-specific examples of this might be "how can I be sure my application will not trigger a bunch of UAC dialogs?" and "will my app have glass?" or "can I get those cool Task Based Dialogs with the blue arrows and stuff?" These are the sorts of things I'll be tackling in some of my upcoming talks. I hope my Vista category will also be useful. My point is, don't wait until Vista ships, then wait to see if any of your clients or customers feel like using it, and then wonder if you have a Vista-ready app. Find out now.

Or as Jim says, "... the opportunity will be tremendous. If you want to ride the wave we're creating with Windows Vista, the best way is to have your application ready by the time we ship! And that is very soon. "

Kate

Sunday, 17 September 2006 15:59:34 (Eastern Daylight Time, UTC-04:00)  #    
# Saturday, 09 September 2006

I'm thrilled to confirm that I will be speaking at Tech Ed in Sun City again this year!

I'm travelling on South African Airways this time (it's been Lufthansa before) and taking a different route, so there will be some novelty along with the familiarity. I just love the energy at this conference; I can't wait to get there!

My talks:

  • DEV 307: Delving into Visual Studio 2005 Team Edition for Software Developers
  • CLI 315: Windows Vista: Tips and Tricks for Targeting Key Native APIs from Managed Code
  • CLI 402: Modifying Applications to Run on Windows Vista

Kate

Saturday, 09 September 2006 12:46:05 (Eastern Daylight Time, UTC-04:00)  #    
# Tuesday, 11 July 2006

So if you want your app to behave well on Vista and have no clue where to start, here's a helpful post from Jeremy Mazner that links to a number of screencasts to get you started. How to tell Vista you need admin privs. How not to need admin privs so much. How to use the power APIs (that's volts and amperes power, not only for smart developers power). How to hook into Vista search.

Download them, watch them, make better Vista apps.

Kate

Tuesday, 11 July 2006 09:55:36 (Eastern Daylight Time, UTC-04:00)  #    
# Monday, 10 July 2006

Jesper Johansson is a world-reknowned security guy. His talks are always highly rated and people love to hear him tell them how to be safer than they are now. So when he says "please don't turn off UAC", will you listen?

Yes, it's annoying to be constantly authorizing things, especially when you just clicked the button to do whatever it is that needs to be authorized. Some of that is an artifact: it shows up far more often in the early days of a new install because you're busy configuring and administering the system. Some of that is because permission sets may still need tweaking. Changing the time zone was moved into "doesn't need admin privs" while changing the time was not, for example, and there may be actions that are triggering a UAC prompt that shouldn't be. This is what betas are all about, testing developer choices against the behaviour of real users.

The other reason for a lot of UAC prompting is apps that demand privs they shouldn't need, because their developers can't be bothered to use per-user stores, for example. If that's your app, and you're testing it on Vista, you need to change it so it works well on Vista. Not leave it as is so it works fine on Vista-with-UAC-turned-off. That's just "it works on my machine", and my developers aren't allowed to say that. :-)

Kate

Monday, 10 July 2006 09:28:28 (Eastern Daylight Time, UTC-04:00)  #    
# Monday, 03 July 2006

From the "did you know" department: Aero is (sort of) AERO because it actually stands for "Authentic, Energetic, Reflective and Open".

These are words that can be interpreted however you like. Does authentic mean "not fake" or does it mean "true to the thoughts the user has about how to interact with the OS?" How can a UI be energetic? Does that just mean lots of bright colours, glowing jelly buttons, and animations? What does the UI reflect? And open to what?

I will say this though, they are all positive and pleasant words, and if a team held those words up as goals while working on software for me, I would expect that they would make me pleasant software. In a UI, that's a good thing.

Kate

Monday, 03 July 2006 20:56:43 (Eastern Daylight Time, UTC-04:00)  #    
# Friday, 30 June 2006

Those of you who were interested in my loader lock topic at Tech Ed this year should probably get this whitepaper from Windows Hardware Developer Central (not actually a place I hang out regularly.) It's a downloadable Word document (8 pages) that tackles things like "what you should not do from DllMain" (this list is a page long), deadlocks, and threading considerations (and remember, we are all going to have to tackle threading considerations eventually). While it doesn't say it's C++-specific advice, in what other language could you "Use the memory management function from the dynamic C Run-Time (CRT)" or "Set global pointers to NULL, putting off the initialization of dynamic members"? It even has Vista-specific advice.

Kate

Friday, 30 June 2006 07:14:35 (Eastern Daylight Time, UTC-04:00)  #    
# Thursday, 29 June 2006

Catherine Heller, Windows Vista Technical Evangelist, is now blogging. She started during TechEd just before her session (one of the very few I attended) and so far has covered tips for interop to native APIs and some Search material. I'm looking forward to more as the summer progresses.

Kate

Thursday, 29 June 2006 07:03:23 (Eastern Daylight Time, UTC-04:00)  #    
# Friday, 09 June 2006

If you attended realDEVELOPMENT_06 and really liked Infocard when I showed it to you, I have news: it's got a name now. Infocard was just a code name, which is why it said "Infocard" on the slides. Marketing has now christened it Windows CardSpace (WCS).

What's more, WinFX (which will be released with Vista but available on operating systems down to XP) will be called the NET Framework 3.0. That's handy, because I was spending a fair amount of time explaining what the heck WinFX was (the FX stands for framework, it's basically the .NET framework plus extra good stuff like WCF, WPF, WF, and Infocard WCS.) I think everyone will "get" what .NET Framework 3.0 means.

Nothing changes in the technology, just the names.

Kate

Friday, 09 June 2006 19:35:50 (Eastern Daylight Time, UTC-04:00)  #    
# Tuesday, 02 May 2006

I installed Vista build 5365 last week. This was just a short time after putting 5308 on bare metal instead of a VPC. And now instead of just "checking it out" and "looking around" I was actually using the OS to do work, specifically writing code. (I was doing Word and Powerpoint work on my other laptop which is still on XP.) There's an interesting emotional thing that happens when you get out of the VPC and onto the metal, and especially when you stop demoing and start doing.

There are some things here I am just loving, somewhat to my surprise.

How long have I been annoyed by having to retype the extension when i rename a file? A decade at least. This is a tiny thing but ooo-weee I like it.

The easiest way to tell what I love is when I try to do it on my other machine and feel a momentary irritation when I can't:

This is a Windows Explorer and the address bar is all buttony and live. So I don't have to click up three times, wait while lists of things I don't care about update, and then drill back to where I want. I keep trying to do this on XP, I have it completely internalized already.

Like Scott Hanselman, I have a LOT in my Start menu. I like this in-place effect a WHOLE lot better than the cascading-off-to-the-side-forever approach.

One thing I was hating: where is Start, Run? I can't live without Start, Run! Turns out Windows-R still works. So does right-clicking on Computer and choosing Manage to get all the MMC stuff you need to admin your box.

Speaking of adminning your box, the User Account Control takes a bit of getting used to. More than once I have had to close Visual Studio and re-open it as admin so the COM component can get registered as part of the build process. But I am developing some habits there and expect to internalize those quickly too. I have a feeling we will all be on Vista sooner rather than later.

Kate

ps: don't draw conclusions about visuals from these shots, I don't have Glass on the laptop (it's an old one) and I don't have anything for screenshots other than Shift-PrtScr then paste into Word. It's nicer in person, really.

Tuesday, 02 May 2006 15:58:55 (Eastern Daylight Time, UTC-04:00)  #