Inside and Out…

An attempt to understand technology better…

Archive for September, 2005

[Download] vCardCE10 – vCard generation library for .NET Compact Framework 1.0

Posted by Gaurav Khanna on September 26, 2005

Few weeks back, I had written ShareContacts – an application for Windows Mobile 5.0 based PocketPC that could be used to share contacts, using the vCard format, with other devices.

Since it was done using .NET Compact Framework 2.0, and also used some APIs specific to Windows Mobile 5.0, I decided to work upon it and get the (almost) same functionality to Windows Mobile 2003 platform.

The result is vCardCE10 – class library that allows you to set few properties and generate a vCard that can be sent as a SMS to share contacts with other devices. All done as per RFC 2426. vCardCE10 is built using .NET Compact Framework 1.0 and is targeted for PocketPC 2003 and SmartPhone 2003 platforms. It comes with complete documentation and can be downloaded from http://www.wintoolzone.com/showpage.aspx?url=dotnet.aspx

Usage is as simple as the snippet shown below:

vCardCE objVCard = new vCardCE();

objVCard.Title = “Mr.”;
objVCard.FirstName = “Gaurav”;
objVCard.LastName = “Khanna”;
objVCard.WorkPhone = “+911234567890”;
string strVCard = objVCard.GenerateVCard(); // send this via SMS to share contact detail

Advertisements

Posted in .NET Compact Framework, Development, Downloads, Windows CE/Windows Mobile | Leave a Comment »

Image Visualizer for VS 2005 Beta 2

Posted by Gaurav Khanna on September 25, 2005

I am currently on the Technology Roadshow across 6 six cities in India, where I am talking about Building performant applications and Debugging Techniques for .NET Framework 2.0.

One of the things the developers here are amazed at are the DataTips that have been introduced with VS 2005, and also with Visualizers. Infact, when I demonstrate the DataSet Visualizer that ships with VS 2005, you can hear the WOW! of the audience 🙂

In the same session, we then go about building a visualizer for the Image class. For those interested, you can download the VS 2005 Beta 2 source code for the same from http://www.wintoolzone.com/showpage.aspx?url=dotnet.aspx.

To activate the visualizer, build the DLL assembly and copy it to <ProgramFiles Folder comes here>\<VisualStudio Installation Folder comes here>\Common7\Packages\Debugger\Visualizers folder

Posted in .NET Framework, Debugging, Development, Downloads, Visual Studio | Leave a Comment »

Adding process enumeration support in Rotor v1.0

Posted by Gaurav Khanna on September 5, 2005

Share Source CLI, better known as Rotor, is one of the best ways to understand how .NET Framework works. And with the source code availability as part of Rotor distribution, its an excellent academic/hobby interest – you can extend it by adding more functionality, or modify the existing one and see how it behaves.

Yesterday, I went about doing the same. One of the functionality which I found missing in Rotor is that of enumerating system process list. .NET Framework’s System.Diagnostics.Process class has methods, like GetProcesses, that allow you to do the same.

So, I went about implementing GetProcesses method overloadsin System.Diagnostics.Process class that allow me to enumerate process list on the local machine only. This required modification in the Platform Adaptation Layer (PAL) of Rotor. Since, I just have it running on Win32 for the moment, I modified the Win32 PAL to implement the support via ToolHelpAPI. Now, on a Windows system, its possible to enumerate the system process list using Rotor, as exemplified by the snippet below:

You can download the updated source files for Rotor v1.0 from http://www.wintoolzone.com/showpage.aspx?url=rotor.aspx. The zipped archive contains Changes for Process Enumeration.txt that indicates where the updated files need to be copied. Once done, rebuild Rotor to get the changes into effect.

using System; 
using System.Diagnostics;

public class EnumProcess
{
    public static void Main()
    {
        Process[] arrProcess = Process.GetProcesses();
        if (arrProcess == null)
        {
            Console.WriteLine("Unable to get process list!");
            return;
        }

        Console.WriteLine("{0} processes enumerated.", arrProcess.Length);

        foreach (Process proc in arrProcess)
            Console.WriteLine("Process ID {0}, Handle: {1}", proc.Id, proc.Handle);
    }
}

Posted in CLR, Downloads, Rotor | Leave a Comment »