Welcome to MSDN Blogs Sign in | Join | Help

A few months back I lead an effort to put to rest a customer issue whereby Office 2003 documents would open from MOSS 2007 document libraries as “read-only”.  When “Edit in Microsoft Word” was selected from the document context menu, the document would show up in Word but the “(Read Only)” was added to the title bar.  When the user attempted to save the document, they were prompted with a Save As dialog asking them to specify a different location and/or file name because the current status was set to read-only.

The contents of the Open and Save dialog boxes were also showing signs of a problem.  The file lists in these dialog boxes which normally rendered the WSS document library were blank.

Even more perplexing was the fact that Office 2003 applications worked fine the first time they were invoked and used with a document library.  Files would open as read-write in Word, Excel, or PowerPoint and stayed that way if you kept that first instance of Word alive by closing the document instead of the application.  The Open and Save dialog boxes also rendered correctly.  But once the application closed, the behavior reverted to the “(Read Only)” condition on subsequent instances.

To top everything off, this did not happen on every workstation in the enterprise.  It is one of the most managed enterprises I have ever worked were all changes are tracked in detail.  When I did a comparison of DLL's between a workstation with the issue vs. one without there was no difference.

We went through the all of the steps in a standard troubleshooting whitepaper.  I used Fiddler to diagnose the SSL traffic from the client and identified a difference in traffic patterns between the First Use and Subsequent Use scenarios.  It is easy to summarize weeks of effort in a couple sentences, but so many approaches were tested and several engineers in Microsoft Premier Support (CSS) were helpful in providing us guidance to rule out possible causes.

As I spent a few hours researching based on the Fiddler and Process Monitor traces, I discovered that it was not normal wininet traffic that was being attempted by Word.  After digging deeper, I discovered that a registry key existed on the workstations experiencing the read-only issue.

Affected systems had a HKLM\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\Web Extender Client\wecctlflags key which was set to a value of 2.  This key existed for older versions of Microsoft FrontPage (2000) which used their own component for internet communications called stsnwi.dll.  The wecctlflags key enabled FrontPage to bypass the standard wininet Windows component and use stsnwi for debugging and troubleshooting purposes.  The stsnwi.dll is no longer shipped as a component of any product but it appears Office 2003 applications still have a check for the wecctlflags registry key and attempts to use stsnwi.dll if the value is set (usually at 2).  When the application is unable to load the DLL it performs a silent fail which results in a blank details Open and Save dialog boxes and documents opening as “read only”.

The wecctlflags key can be safely deleted from the Windows registry.  If working with the registry is not something you are comfortable with or not experienced doing, then take appropriate precautions.  Backup the registry and make sure you have a recent backup handy.  Or seek a qualified IT professional to assist you.

We have not tested against Office 2007 applications in this environment as the registry key has since been eliminated from the workstation population.

It’s been awhile.  I still have the i730 and it’s a bit beaten and worn from years of use.  That will soon change.

I dusted off the old blog and picked up around here.  Let’s try this again and see what happens.

File this one under "I had no idea so I best share what I learned."

Over a couple of days during the past two weeks I have been working with a customer to isolate a memory leak in a ATL/C++ application.  This particular customer application leverages the msxml3 component to do some document translations on imported data.  The size of the data can be fairly substantial and allocated memory is not being released either.

I am not the foremost authority on ATL/C++ but I'm not a newbie either.  I know my way around the basics of WinDbg to isolate problems.

It turns out that MSXML gives tools like Rational's Purify and Microsoft Customer Support Services (CSS) LeakDiag false positives because of the way memory is managed.  Based on the documentation I have read, there are five memory managers used by MSXML which are designed for performance and scalability.  To start, the garbage collector in MSXML allocates a pool of memory for the management of cached objects.  Wrapped around the OS heap is a multi-processor optimized heap manager which also caches memory for performance.  In addition there are two memory managers.  One is designed for large memory allocations and the other the COM allocator.  Both cache memory or allocate large amounts of memory.

So you can see how easy it would be for these memory tools to incorrectly identify MSXML as a memory-leak culprit.  Microsoft KB 304227 is recommended reading if you suspect MSXML garbage collection needs to be tuned further.

On the other hand, if you really suspect your own code then I recommend the often overlooked Debug C Run-Time Library.  John Robbin's does a great job laying this out in Chapter 17 of his Debugging Applications book.  You can find details in MSDN as well.  And if you are a regular Bugslayer reader then this is all old hat.

So I get these e-mails from SteveB and Billg today and guess what?

After five years, I no longer double take when I see one of their names in my inbox.  The double takes stopped after the first year.  In my role out in the field, e-mails from Steve and Bill are always addressed to the company.  I have only received one e-mail from Steve where I was on the cc: list.  It was a congratulatory note for our teams’ response to a customer critical situation where depth of product knowledge was needed.

Today was a bit different because Steve sent out a “Heads up” e-mail letting us know an important announcement was being made later in the afternoon.  But I did not expect this news.  What did not surprise me was the announcement of Ray Ozzie as the new Chief Software Architect.  I could see a mentoring relationship going on there since Ray joined the company.

The Gates Foundation is doing great things.  Bill and Melinda bring a lightning rod of visibility to the issues of global health and education.  I wish Bill all the best as he transitions into this new role.

Today the customer asked me a simple question.  And sometimes it is simple requests that wind up with involved answers.

How can I decimal align floating-point output in C#?

Which basically means "right align" in our instance.  The customer is a seasoned C/C++ developer and the float formatting from sprintf( ) immediately comes to both our minds.  My initial answer to him is to use .ToString with the C# formatters # and 0 to use #,###.000  To my surprise, everything is left aligned output:

42.000
128.500
4.100

Instead of the expected:

    42.000
   128.500
     4.100

I am obviously too accustomed to using the custom numeric formatting in Excel.  After a few minutes digging around, I found that a composite format needs to be specified.  I come up with the following (x is a double = 42.00):

string s = String.Format( "{0,10:#,###.000}", x );
Console.WriteLine( s );

Which I shortened down to:

Console.WriteLine( "{0,10:#,###.000}", x );

And gives me the output I expected:

    42.000
   128.500
     4.100

But something does not look right.  Ildasm confirms that the double is boxed in both the String.Format and WriteLine operations:

IL_003c:  ldstr     "{0,10:#,###.000}"
IL_0041:  ldloc.0
IL_0042:  box       [mscorlib]System.Double
IL_0047:  call      void [mscorlib]System.Console::WriteLine( string, object)

I found it very interesting that the box statement for the double variable containing the value 42.00 occurs on IL_0042 (I know, hex 42, but none the less...).  If you are processing a flow of numbers for output (looping) and performance is important, consider breaking down the format string and execute the following:

Console.WriteLine( String.Format( "{0,10}", x.ToString( "#,###.000" ) ) );

Most coders may find the single line compact and clean looking.  And in many cases where this line of code executes once and moves on, it sufficiently does the job.  Thanks to the Jeffrey Richter and Rico Mariani's in the world I find myself looking at lines of code more closely in order to fully understand the cost of code instructions in the simplest examples.

Voice Command on the Samsung i730 rocks.  I have a minor limitation with the Sony Ericsson HBH-662, but I will live with it because of Voice Commands accuracy.

I work from our Reston, Virginia office or my home office when I am not at a customer site.  In both locations, I have very poor reception with Verizon.  My home is on the back slope of a ridge and the Reston office is shrouded in steel.  I want my customers to use one number to reach me at any time or place.

When I work from home or the Reston office, I end up forwarding my i730 to the land line.  And in our progressive office in Reston, I have the additional step of forwarding my office number to my desk for the day.  Those with Verizon may or may not know that dialing *72 plus a phone number will forward your calls to that phone number.  You will still incur applicable airtime charges for calls received, but you can hold customer calls without the fear of dropping mid-sentence.  To cancel the call forward, you simply dial *73.

In order to simplify the call forwarding life, I have created an Outlook contact simply named "Forward" with the following:

  • Work: *727035551212
  • Home: *727035551213
  • Mobile: *73

As a result, I can issue the following Voice Commands: "Call Forward ... Work" to forward the mobile phone to my Reston desk number.  I can command "Call Forward ... Mobile" to cancel the call forwarding.  The caveat for anyone new to this type of mobile life is remembering to cancel the forward!

SmartPhone Search For Signal

Of course, after forwarding the calls, I issue the "Flight Mode On" voice command.  When the SmartPhone loses signal it munges away battery life because it's constantly looking for that signal.  I wish the SmartPhone had a more intelligent way of dealing with extended period of lost signal.  Search constantly for 5 minutes, search every 10 seconds for the subsequent 2 minutes, and every 30 seconds for every minute beyond that until it finds a signal or the owner uses the device.  The cycle could reset only if the phone obtains a signal for 30 seconds or more.  Right now the phone just burns the battery constantly searching for a signal.

An additional option (key word being "option") is the ability to enter flight mode if the phone does not find a signal after X minutes.

I sure that enough IT professionals encounter this problem working in signal shielded data centers or large steel buildings.

Today is the second presentation of the Anders Hejlsberg discussion on C# 3.0.  This is a presentation I wanted to attend twice just to take it all in.  It's in a smaller room today, but is also being broadcast into two overflow rooms.  The coordinators requested a third presentation for tomorrow on the spot.  Keep an eye out on commnet for a possible third presentation.

There are exciting additions coming to the C# language in 3.0.  The new features in C# 2.0 are laying the groundwork for LINQ and C# 3.0 (Orcas timeframe).  Anders has laid out solid design goals for future versions of C#.  One stood out to me: To avoid tying language features to a specific API or technology.  Anders wants to avoid tying C# to something that would result in the language depreciating with the technology.

It is this rational envisioning and dedication that earns Anders the respect of the developer community.  That respect was clearly demonstrated by a double-overflow audience and a (potentially) second encore.  I encourage you to check out the future of C# and communicate your feedback.  The PDC hands on labs are available for public consumption.

[Typo Edit at 3:42pm]

In room 501AB, Media Center "Designing for the 10 Foot User Experience".  Media Center Extender demo on a "pre-pre-beta" XBOX 360.  After a couple of technical snafus, the box was up and running and streaming HD from the MCE box.

 

Jim Allichin announced the Language Integrated Query (LINQ) Framework this morning.  Anders Hejlsberg and Don Box performed a great demo of this technology.  LINQ basically provides the the ability to query any array or collection of objects in managed code.

I was really blown away by the ability to perform joins between in-memory data and results from a SQL or Access database.  The demo application performed queries against the results from Process.GetProcesses( ).

query = from p in Process.GetProcess( )
where p.WorkingSet > 1024 * 1024 * 4
orderby p.WorkingSet descending
select new {
    p.ProcessName,
    p.WorkingSet
};

You can then foreach through the results.  From that point on (and the dying notebook battery), they had my rapt attention and my notes became slightly weaker.  I will try and whip up the join sample again.

NOTE: I recommend viewing an excellent Scoble interview with Anders Hejlsberg on Channel 9 regarding LINQ.

This posting will be a "living document".  I will update with relevant notes during the day today and tonight.  I may flush out individual bullet points in greater detail.

This afternoon I attended sessions on:

High Performance Computing with the Windows Server Compute Cluster Solution

Programming with Concurrency (Part 1)

  • Recommended reading:
  • Herb Sutter article: "The Free Lunch is Over"
  • Vance Morrison - "What Every Dev Should Know About Multithreaded Apps", MSDN Aug/Oct 05
  • Andrew Birrell, "Programming with Threads in C#"
  • Asynchronous Call docs on MSDN
  • Doug Lea, "Concurrent Programming in Java" - The concepts apply to managed code as well.
  • Intel Platform 2015

A Lap Around IIS7 [Currently In Progress 4:45pm PDT]

  • History of IIS
  • Since RTM, IIS6 has had ZERO critical security fixes issued.
  • Metabase is DEAD in II7 - See applicationHost.config as the global web configuration file
  • inetmgr is DEAD in II7 - See web.config in the virtual directory
  • Web Management Tool is the new UI
  • Modular design enables you to remove any or all modules.  Remove CGI from your web.config if not in use.  Remove all MSFT modules and implement others.  Reduce the patch/maintenance overhead and attack profile of your web server considerably.
  • Improved diagnostics in IIS7 - View real-time server state information of Sites, Apps, AppPools, and AppDomains
  • Extensibility is a big part of IIS7 - Custom modules and logging events

[edited for missed formatting errors and adding PDC2005 category - oops!]

 

NOTE: You can watch the BillG PDC 2005 keynote online.  [Sept 14 6:19pm PDT - Original Post Sept 13]

 

Bill Gates launched the keynote for PDC 2005.

 

Highlights include:

  • Joked about Monday's black-out in Los Angeles and his past comments on software becoming as reliable as the electrical grid.
  • PDC statistics: Sold-out faster than any previous PDC. Longer waitlist than any other PDC. Outstanding considering the popularity of most conferences has dwindled (no Comdex, etc.)
  • Overview of the history of software development from 1975, 1985 (DOS), 1995 (Windows/GUI), and 2005 (Internet, .NET, XML, and Web Services).
  • Iterated the difficulty companies have recruiting talented developers. Lead-in to a very humorous video starring BillG and Napoleon Dynamite. The pretense of a college recruiting tour made for some hilarious scenes between Bill and
    • BillG: “Where do you want to go today?”
    • Napoleon: “Wherever I want to! Gosh!”
    • Good dig at tchotchki’s. BillG is managing the MSFT “booth” when Napoleon asks “Are those pens free?” When Bill responds “Yes”, Napoleon grabs a bunch and runs for his life.
  • Emphasizes that migration to 64-bit should be painless. The only potential hurdle is the availability and reliability of hardware drivers for 64-bit.
  • Emphasis on the importance of XML and how it’s an essential part of Microsoft products and technologies: SQL Server 2005, Web Services, Visual Studio, and the standard file format for Office 12.
  • Windows Vista and Office 12 will ship together
  • Availability of Windows Presentation Foundation and Windows Communication Foundation on Windows XP
  • Windows Vista has been developed based on three pillars:
    • Confident: Safer and more secure desktops
    • Clear: More intuitive application design (Office/Vista)
    • Connected: Broadband users outnumbered dial-up for the first time in 2005

 

Introduced Chris Caposelli, Vice President Information Worker

 

  • Covered Windows Vista features that Office 12 builds upon
    • Alt-Tab improvements. Particularly the “flip feature”
    • Search is available everywhere (Start, Sidebar, Explorer).  A single indexer in Vista for all applications (Outlook, MSN Search, etc.)
    • XML driven OS. Document properties are metadata.
    • Stacks of documents with common properties in metadata
    • Drag and dropping of documents onto stacks to paint the metadata with the property of that stack
    • Sidebar, Gadgets, and the Gadget Library. Library includes RSS Reader, Windows Media Player, Clock, and Search
    • Sideshow: Imagine a notebook with a small display on the top and a small thumb controller for navigation. The Sideshow display enables you to view the status of applets related to your Calendar and Contacts. Custom applets for Expedia are in development already. See www.microsoftgadgets.com for more information
    • Parental Controls – Microsoft has worked with the ESRB to build rating policies for users. Do not want junior playing Grand Theft Auto? Configure his user account to the Teen ESRB rating
    • IE7 has built in heuristics to detect malicious sites.  Quick-Tabs, Alt-Tab functionality to its tabbed browsing.
    • Microsoft is establishing a Phishing Service listing known Phishing URLs.  If you subscribe to the service, IE7 will notify you that a site is suspected of phishing.
    • Huge RSS improvements in IE7 and Vista.  Auto-discover RSS feeds for a site.  RSS store built into Vista.  One store for all readers to leverage.
  • Publicly introduced Office 12 for the first time
    • Word 1.0 had 150 commands. Word 2003 has over 1500 commands.
    • Usability study participants asked for features that already existed in Word.  The indication was that they could not find the features.
    • Focus on results oriented Office System.  Revamped toolbars and menus.  Features are readily available.  Allows all users to become power users.
    • RSS Support is built into Outlook.  You can cache the feeds and read them offline.
    • Tighter SharePoint integration with products like Outlook and Powerpoint demonstrated.

 

BillG went on to provide the next steps going forward before thanking the attendees and introducing Jim Allchin:

  • Build on the technological foundation provided
  • Focus on the user experience
  • Build connected systems
  • Ride the 2006 PC wave
  • Software is the key

While I was on the road last week, the announcement for the PDC Session Scheduling Tool went out.  I hope you took the time to fill this out.  I have staffed one or two D.C. area product launch events where the room simply was not big enough to hold everyone interested in a topic.  This is an excellent opportunity to provide input that will result in your increased satisfaction of PDC 2005!  If you have not, please rough out your schedule already!

I actually selected two or three sessions per time-block.  The abstracts are fairly descriptive, but five minutes into the talk is not the time to come up with a backup session when you realize the first one was not what you expected.

Most of your schedule will contain sessions on new technologies.  It is a really smart idea to do pre-reading on each of the session topics before you fly out to L.A.  Note that many of these sessions are at 300 and 400 levels.  Do your pre-research and show up ready to ask questions.  PDC is a great opportunity to receive answers from the horses mouth.

Is there a particular session you are looking forward to?  Use the comments to post your top three and compare notes with others on the road to PDC 2005.

My top three so far:

  • TLN307 - C# Futures with Anders Hejlsberg.
  • DAT301 - High Performance Computing
  • FUN323 - Microsoft Research: Future Possibilities in Concurrency

But I am very curious to attend a session on Longhorn ... er, Vista Media Center Edition titled:

  • PRS322 - Developing for the 10-Foot Interface

I will be at a customer focused event on Thursday and Friday, so I will miss some of the interesting symposiums and panels on those days.  There are a considerable number of panels on Friday that pique my interest.

 
Page view tracker