PETZOLD BOOK BLOG

Charles Petzold on writing books, reading books, and exercising the internal UTM


Recent Entries
< PreviousBrowse the ArchivesNext >
Subscribe to the RSS Feed

Programming Windows 6th Edition: What Happens Next?

June 1, 2012
Roscoe, N.Y.

I know the life of a freelance writer might seem glamorous at times — nonstop publication parties, supermodel groupies, hanging out in the secret Writers' Cafe with Stephen King and J.K. Rowling — but sometimes there's some real grunt work involved.

Just two weeks after the Consumer Preview ebook of Programming Windows 6th edition went on sale, Microsoft performed an unexpected early drop of the Windows 8 Release Preview.

This new release does not mean that the book is now "entirely wrong." But it does means that I'll be spending this weekend converting all the code samples to the Release Preview and checking to see if they still work right.

The Consumer Preview ebook has 81 sample programs, and they're available in both C# and C++ versions, so what I really want to avoid is re-creating all the projects in the new drop of Visual Studio. Instead, I'll be modifying the existing projects so they seem as if they were created in the Release Preview version of Visual Studio, which means determining what has changed in the standard templates, and writing a custom program that converts the existing projects into new projects.

At that point, I can then recompile and run all the programs to see if they still work, and put together a short (I hope) document that describes the differences between the Consumer Preview and Release Preview of Windows 8 as they affect the Consumer Preview ebook of Programming Windows 6th edition.

I'll then ZIP up the new versions of the programs with this document and hand it over to Microsoft Press so they can hand it over to O'Reilly Media to put on the Programming Windows 6th edition page on the O'Reilly site. If you've already purchased the Consumer Preview ebook of the book, O'Reilly has your email address, so they should be able to notify you that this updated code collection is available. If that doesn't happen, it should be available early next week, and I'll let you know via a blog entry.

For the the first 7 chapters of Programming Windows 6th edition I created all the programs by selecting the "Blank App" template in Visual Studio. In the Consumer Preview, this template generates files for a class named BlankPage, a name that makes sense when the page is blank, but becomes ridiculous when you start putting stuff on the page. In the Release Preview version of Visual Studio, the name has become MainPage.

There are other changes: The ApplicationPageBackgroundBrush referenced in BlankPage.xaml is now ApplicationPageBackgroundThemeBrush in MainPage.xaml. The PNG files for the various program logos are now blank rather than portraying stars. The Common directory now only contains a different version of StandardStyles.xaml; all the helper code files are gone (but they are generated by the other templates). The App.xaml.cs file is more extensive, AssemblyInfo.cs no longer indicates that your program is copyright by Microsoft, and the .csproj and .vcxproj files have some changes as well.

So while you're enjoying this first weekend in June by heading to the beach or lounging around the barbecue or relaxing in the stands at Roland Garros, I'll be chained to my desk translating programs from one pre-release version of Windows 8 to another.

But with that task out of the way, I can then resume the really fun part of this job: writing more chapters that go ever deeper into this fascinating new manifestation of Windows.

Programming Windows, 6th Edition

Special Price through (approximately) July 2012!

For just $20, you get:

(1) the Consumer Preview ebook right now
(2) the Release Preview ebook in early August
(3) the final ebook in November

Programming Windows 6th edition
Programming Windows 6th Edition
Consumer Preview eBook



Comments:

Yep, after opening Hello app (created in beta) in RC of Visual Studio I see some error in cs file, but recreated in RC blankApp and error missed.

In Xaml almost the same as the book, + to you saed is Tab stop attribute added.

x:Class="Hello.MainPage"

IsTabStop="false"

Is Justify, the member of TextAlignment, is now supported in Release Prewiew of WinRT?

I don't understand, what Justify must do.

— Guest, Fri, 1 Jun 2012 15:36:45 -0400

Just wanted to say thank you for updating all your samples so quickly! I've just finished working my way through PW 6th Ed. and have found it a really helpful and enjoyable experience. You got me switched to Windows programming with PW 1st edition back in 1988!

I was inspired by your DependencyObject Class Hierarchy sample to build myself a little 'class browser' app and discovered that there are 1712 classes/interfaces in the release candidate, compared with 1687 for the consumer preview - they snuck in 25 new classes for you to write about!

Best wishes and thanks again,

Russell Archer, Fri, 1 Jun 2012 18:24:26 -0400

Thanks for your quick update. In the meantime I have to spend some time with my supermodel groupies. Freelance software developers have at least as much groupies as writers do.

Pierre MF, Fri, 1 Jun 2012 19:54:18 -0400

"Instead, I'll be modifying the existing projects so they seem as if they were created in the Release Preview version of Visual Studio"

Sure you'll have results that compile and execute properly, but the projects will be subtly different from what would be created by the new version of Visual Studio.

Visual Studio is often capable of migrating projects automatically, and the results compile and execute, but the migrated projects differ from what newly created ones would have been.

Microsoft did some pseudo-migrations in MSDN examples, and the results are considerably different from newly created projects.

This is not to detract from your kind and diligent efforts. It's just that "as if" isn't really likely to be "as if".

— as if i had a name, Sun, 3 Jun 2012 19:46:15 -0400

> the projects will be subtly different from what would be created by the new version of Visual Studio.

Perhaps you should wait to see the results before you make unwarranted assumptions. — Charles

I hope in your Win 8 book, it will have a sample to illustrate how to implement the "Guided Access" as in IOS6 http://www.theverge.com/2012/6/11/3078350/apple-ios-6-guided-access-parental-control

Joe Lee, Mon, 25 Jun 2012 23:56:15 -0400

Not likely if there's not a Windows 8 API for it. — Charles

The following binding is not working in Win RT but working in wpf. Is it a limitation or by design or bug?

<Style TargetType="ListViewItem">

<Setter Property="IsSelected" Value="{Binding Selected, Mode=TwoWay}"/>

Joe, Sat, 14 Jul 2012 08:17:04 -0400


Recent Entries
< PreviousBrowse the ArchivesNext >
Subscribe to the RSS Feed

(c) Copyright Charles Petzold
www.charlespetzold.com