A Walkthrough for WCF (MOC 6461)

31 במאי 2009

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...
תגיות: , ,
תגובה אחת

Fiddling with Fiddler 2 on localhost

27 במאי 2009

Fiddler 2 is a great tool to monitor the http activity on a computer, and an excellent debugging and teaching tool for WCF and ASMX. It’s free and you can download the latest version from here. What I like about it most, is that it can display SOAP messages - request and response as a DOM. You can really see what those contract attributes are doing : ) For my very simple Calculator.Add operation it displayed the following: Nice, no? The problem is, that it works best when monitoring traffic...
5 תגובות

Develop ASMX and WCF with Visual Studio 2008 and 2010 Side by Side

My Visual Studio Side by Side Problem On my new laptop I had installed VS 2008 but had not done any Web Service development - so I hadn’t yet installed IIS or registered ASP.NET. Then I installed VS 2010 Beta 1. A while later I began preparing samples for a course in WCF that I am teaching these days – using Visual 2008. So I installed IIS 7.0 (I am running Vista Business) and registered ASP.Net from the Visual Studio 10.0 command prompt. I created a simple “Hello World” ASMX Web Service and a...
אין תגובות

WPF, Windows Forms and ATL Part 3

25 במאי 2009

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.Integration namespace which is a Windows Forms Control and can reference any...
תגיות: , , , ,
אין תגובות

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) I used 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...
תגיות: , , , ,
תגובה אחת

ATL and Visual Studio 2010 Beta 1

23 במאי 2009

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, methods of the event interface are not added to the idl, nor...
אין תגובות

StaticResource and DynamicResource

19 במאי 2009

So, whats the difference, and when should I use each? I am referring of course to the difference between the behavior of these two XAML elements:       <Button Background="{StaticResource myBrush}">Static Resource</Button>       <Button Background="{DynamicResource myBrush}">Dynamic Resource</Button> Where “myBrush” is defined as a resource in a scope that contains the buttons. The Difference Static resources are evaluated at compile time. Dynamic resources are evaluated at runtime, when they are needed. That includes whenever they are replaced with new objects. Note that if the resource itself is derived...
4 תגובות

Security Warning for <Project Name> Dialog Box

18 במאי 2009

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 Details” button follows. When I press...
תגיות: ,
7 תגובות

MediaElement and More with WPF

17 במאי 2009

Download the code for this article here. In this post I am going to describe a simple video player application written with WPF. It is not a groundbreaker, but it provides easy-to-copy demonstrations of: Databinding between a collection of objects and a control. Writing a DataTemplate for ListBox.ItemTemplate Databinding between properties of two controls. Controlling the MediaElement, in particular how to create a Position slider that works. Writing a ControlTemplate for Button.Template Animating...
12 תגובות