David Sackstein's Blog

"The more that you learn, the more places you'll go.”, Dr. Seuss

Browse by Tags

All Tags » DEV (RSS)
Top Tips for Rapid Application Development
In recent weeks I have been busy on a number of projects with very tight, almost impossible schedules. When schedules are tight, there is simply not enough time to implement all the steps of a formal development procedure. But I have found that some good practices shine through as time savers every time. Not only do they save time, but they also help produce exensible, maintainable code – which also saves time in the long run. So here are my top tips for Rapid Application Development. Document the...
Rendering Video with VMR9 on a Windows Form
This week I taught a class on video and DirectShow and sat down to prepare some demos. In this demo I show how to use the Video Mixing Render 9 (VMR9) in Windowless mode to render video on the Form of a Windows Forms application. As in my posts on MSXML I found that the smart pointers of comdef.h and comip.h really helped to clean up the code. Why, programming the VMR9 in C++ can be as elegant as C# ! You can find the complete source code here . High Level Design For this demo I started with the...
Mapping MediaElement onto a Sphere with WPF
In my previous post I created a 3D cube, mapped a MediaElement onto each of its faces and animated the camera around the cube. In this post, I will replace the 3D cube with a sphere and wrap the video onto the surface of the sphere. I omit the camera animation for simplicity, but you can add it back, of course. You can download the source code here . In order to create the sphere mesh I made use of Charles Petzold’s elegant SphereMeshGenerator. In Chapter 6 of his book (3D Programming for Windows...
A Custom Animation Class - Point3DAnimationUsingPath
For 2D graphics WPF provides three classes for animating points: PointAnimation (for linear interpolation), PointAnimationUsingKeyFrames and PointAnimationUsingPath. For 3D graphics WPF provides only two: Point3DAnimation (for linear interpolation) and Point3DAnimationUsingKeyFrames. There is no built in class for animating points over a path in three dimensions. In this post I will show you a custom animation class that I wrote to partially fill that gap. In the next post I will put it to use in...
Instrumentation Tip for ASMX Web Services
This post describes a simple way to trace all method invocations on an ASMX Web Service. The source code for the demo can be downloaded here . Problem I am currently adding some features to a customer’s application that exposes its core functionality as an ASMX Web Service. About every mistake in the book was made in the design of this product, so I was having a rough time understanding the API of the service, never mind the implementation. For a start, the methods are not strongly typed, mostly...
WCF Transactions – Barebones Demo – Part 4
In this post we will run the demo developed in the previous posts in the series and analyze the results. The last sections contain conclusions and suggestions for further reading. The other posts in this series are: WCF Transactions – Barebones Demo – Overview WCF Transactions – Barebones Demo – Part 1 (Tools) WCF Transactions – Barebones Demo – Part 2 (Service Code) WCF Transactions – Barebones Demo – Part 3 (Client Code) You can download the source code for the series from here . Run the Demo ...
WCF Transactions – Barebones Demo – Overview
In the next four posts, we will be building a barebones project to demonstrate WCF’s support for Transactions. The other posts in this series are: WCF Transactions – Barebones Demo – Part 1 (Tools) WCF Transactions – Barebones Demo – Part 2 (Service Code) WCF Transactions – Barebones Demo – Part 3 (Client Code) WCF Transactions – Barebones Demo – Part 4 (Analysis) You can download the source code for the series from here . The demo focuses on the usage of these properties: TransactionScopeRequired...
WCF Security Scenarios - Barebones
You can download the source code for these posts here . In his book, “ Programming WCF Services ”, Juval Lowy does a superb job of explaining the principles of WCF Security and simplifies the subject by discussing 4 typical security scenarios. I implemented those scenarios as demos for my latest class in WCF and I would like share them with you in this and the next few posts. Why should you read on? These demos are concise yet complete. My approach has been to use configuration files only - no code...
TreeView DataBinding and The Composite Pattern
In the previous post I demonstrated use of the HierarchicalDataTemplate to style nodes based on the type of the object that they are bound to. That declarative recursion gets you true separation between data and presentation. In this post, I will show how I made use of the Composite Pattern , INotifyPropertyChanged and BindingSource<T> to implement objects for DataBinding with the TreeView. In the next post I will show how I used LINQ to XML to read the data from an XML file. The Composite...
A Walkthrough for WCF (MOC 6461)
The source code for this walkthrough can be downloaded here . I compiled this walkthrough for MOC 6461 that I am teaching these days. It corresponds to the work convered by units 1 and 2 of the MOC and will guide you through the following steps: Define the Contracts Implement the Contracts Implement a WCF Service hosted in IIS Create a Client Application Add a Self-Hosted Console Application for the Service Modify the Client Application to use the Console Host Add a Self-Hosted Windows Service for...
WPF, Windows Forms and ATL Part 3
Continued from Part 2 . So now for the second scenario. Hosting WPF controls in legacy containers. Well let’s start with hosting a WPF control in a Windows Form. Then we’ll have a bash at hosting a WPF control in an unmanaged application (hee, hee). Here is the source code for the three projects described in this post. Hosting WPF Controls in a Windows Form Hosting WPF Controls in a Windows Forms application is quite straightforward. The key is the ElementHost control in the Systems.Windows.Forms...
WPF, Windows Forms and ATL Part 2
Continuing from Part 1 . We are still discussing the first scenario for WPF Interop, namely using COM and Windows Forms User Controls in a WPF application. Here I will be giving some examples. In the next post I will discuss the second scenario – hosting a WPF control in a Windows Form application. You can download all the source code for Part 1 and Part 2 of this article here . Please note: All projects were prepared with Visual Studio 2010 Beta 1. WPF Application using a Simple COM Object (ATL...
WPF, Windows Forms and ATL Part 1
OK. I finally managed to create the sample ATL called Polygon from the ATL Tutorial on MSDN using the Visual Studio 2010 Beta 1. The problems I mention in the previous post remain; I simply hand-coded the text that the ATL wizard failed to create (well, maybe simply is not appropriate here). Anyway, back to interop. We have two scenarios to examine: WPF using COM objects and Windows Forms User Controls Windows Forms using WPF controls Let’s start with the first. In the rest of this post I will describe...
ATL and Visual Studio 2010 Beta 1
I am working on a post or two on the subject of WPF Interop with ATL and Windows Forms. I would like to demonstrate: ATL Simple Control in a WPF Window ATL ActiveX in a WPF Window Windows Form user control in a WPF Window WPF control in a Windows Form However, I encountered an unexpected setback: Its very difficult to create ATL projects with Visual Studio 2010 Beta 1! The ATL Wizard doesnt add implementations in the control to methods you add to the interface. When implementing connection points...
Security Warning for <Project Name> Dialog Box
Recently, a message with this caption started popping up when I open some of my projects with Visual Studio 2008. The detailed text of the message is: The <Project Name> project file has been customized and could present a security risk by executing custom build steps when opened in Microsoft Visual Studio. If this project came from an untrustworthy source, it could cause damage to your computer or compromise your private information. Load Project for Browsing Load Project Normally A “More...
More Posts Next page »