December2003December 2003

Threading: Break Free of Code Deadlocks in Critical Sections Under Windows

Critical sections, a mechanism that prohibits more than one thread at a time from executing a particular section of code, is a topic that has not received much attention and thus tends not to be well understood. A solid understanding of critical sections in Windows can really come in handy when you need to track down multithreading performance issues in your code. This articles delves under the hood of critical sections to reveal information useful in finding deadlocks and in pinpointing performance problems. It also includes a handy utility program that shows all of your critical sections and their current states. Matt Pietrek and Russ Osterlund

MSMQ and .NET: Send MSMQ Messages Securely Across the Internet with HTTP and SOAP

When creating a distributed system you frequently need to provide for communication between two entities that are not in sync. Microsoft Message Queue Server (MSMQ) provides the kind of store-and-forward messaging in a pre-built infrastructure that can help you address these kinds of messaging needs. In the past, MSMQ was accessed using a COM wrapper. Now there's a .NET wrapper that lets you accomplish your messaging goals easily from your Framework-based code. To illustrate the use of the wrapper, the author builds a messaging application, sends MSMQ messages over the Web, and discusses messaging security. David S. Platt

Remoting: Managing the Lifetime of Remote .NET Objects with Leasing and Sponsorship

Leasing and sponsorship is the solution for managing the lifecycle of a remote object in .NET. Each object has a lease that prevents the local garbage collector from destroying it, and most distributed applications rely upon leasing. There are several ways in which objects and clients can extend the lease, including dedicated sponsor objects. In this article, the author explains leasing, shows how to configure it, and how it relates to the various remoting activation models. He then discusses design guidelines and options, along with their impact on throughput and performance. Additionally, he introduces a helper class used to automate the management of lease sponsors. Juval Lowy

Beyond Macros: Create Word and Excel Smart Documents with C++ and XML

One of the coolest new parts of Office 2003 is a programmability feature called Smart Documents, which allows developers to augment Word and Excel documents with programmable content and behavior. Typically, examples illustrating Office programmability use Visual Basic or Visual Basic .NET. In this article, the author develops a Smart Document for Excel using C++. He describes the new ISmartDocument interface and shows how to use it to manage a simple task list such as an Excel spreadsheet. Mike Kelly

Office 2003: Host an Interactive Visio Drawing Surface in .NET Custom Clients

Microsoft Office Visio 2003 introduces a new drawing component that allows you to embed an interactive drawing surface into your application's user interface. You can drive the Visio drawing component from events in your host application or with data from a Web Service and an ADO.NET data adapter. The Visio drawing component supports the rich Visio application programming model, giving you control over how graphics are used and displayed on the drawing surface. This article explains how to embed the Visio drawing component into a C#-based Windows Forms client app that retrieves data from the Fabrikam 2.0 Web Service. Mai-lan Tomsen Bukovec and Blair Shaw

Code Download (1,465 KB)
.Chm Files

Columns

Editor's Note: A Look Back and a Look Ahead

New Stuff: Resources for Your Developer Toolbox

Theresa W. Carey

Web Q&A: Virtual Directories, Releasing DB Connections, and More

Edited by Nancy Michell

Data Points: Exploring SQL Server Triggers

John Papa

Cutting Edge: Custom Design-time Control Features in Visual Studio .NET

Dino Esposito

The XML Files: A Survey of Publicly Available Web Services at Microsoft

Aaron Skonnard

Advanced Basics: Windows Forms Q&A

Ken Spencer

Design Patterns: Asynchronous Wait State Pattern in ASP.NET

Lyn Robison

C++ Q&A: Docking the Menu Bar, Abstract Classes vs. Interfaces, and More

Paul DiLascia

Talking To…: Steve Lombardi Discusses the Highlights of Microsoft MapPoint 2004