Nothing at all and Everything in general.

What Does Windows 8 Mean for Windows Phone Developers?

It was only a few weeks ago that Windows 8 was unveiled at the Build conference. At first glance it looks a lot like Windows Phone with heavy use of the Metro visual language. The only part of the system that hasn't had the Metro touch is the desktop (unlike previous versions of Windows the Desktop is not something that is always running). The Start menu looks like the Windows Phone start screen only it scrolls horizontally instead of vertically. The only mention of Silverlight is that you could still use it in Desktop mode for backwards compatibility, but the Metro [default] instance of IE would run no plug-ins, including Silverlight. The programming model also is not based off of Silverlight or the Desktop .Net runtime. Its based on something new called WinRT (Windows Runtime). 

At first glance this is something that has concerned Silverlight and Windows Phone developers. At first glance some one might come to the conclusion that the skill in which he or she has invested has become second class in Windows 8. Is Silverlight really getting killed off? What's going to happen for the Silverlight based Windows Phone?

I don't know the future any more than the next person, but what I saw at Build isn't something that raised concern. I found it to be rather reassuring. Before I explain why let me grant the elephant in the room, the rumor that Silverlight is going to be dead. I don't believe this rumour. For years people have predicted that certain Microsoft Technologies were dead (DirectX, .Net, and many other technologies that we still use today). But I'll grant it anyway so that we can explore what seems to be a popular concern. 

Let's assume that next year Microsoft announces that it is going to sunset Silverlight and toss out the Windows Phone programming model in favour of the Windows 8 programming model. What does this mean for the skills that you have developed? Are they now useless? You've been developing skills in C#/VB, XAML, asynchronous programming, and some APIs that were specific to Silverlight and Windows Phone. Let's look at how each one of these will contribute to your Windows 8 development. 

Languages: C# and VB

C# and VB are still being used on Windows 8. If you've been using these languages you can continue to use them. Additionally if you know C++ or have algorithms that had been written in C++ you'll be able to port them over to Windows 8. Windows 8 also supports JavaScript as a programming language too. 


XAML is still used on Windows 8 for building your UI. Many of the elements you've become familiar with are present in addition to some new ones. No huge changes there. 

Asynchronous Programming

One of the challenges for developers that were new to Silverlight was that task that one may have been used to doing synchronously are only available as asynchronous calls. On Windows 8 you'll find that many of the tasks that were asynchronous in Silverlight and Windows Phone are still asynchronous. Additionally other APIs have been made asynchronous, including File IO. 

The Familiar and What This All Means

You'll come across APIs that look similar of not identical to what you've seen in Windows Phone and Silverlight. Windows 8 has the concept of an application getting tombstoned, specifying the permissions it needs, and so on. Windows 8 Metro applications will only be distributed through the Marketplace. Doesn't all of this sound familiar. If you are a Windows Phone developer it should. You've already got a head start on Windows 8 development. This is far from the doom and gloom picture that some stories would have some one believe. 

If you want to dive into Windows 8 programming the 64-bit development images are available for download. I suggest running them on real hardware. I tried them in the emulator VirtualBox and it's just not the same experience there. 

Improved FindControl for Windows desktop and mobile

A few days ago I posted some code containing an implementation for a Windows Forms version of FindControl. Aviad P. pointed out a correction and a way that the routine can be simlified. While I had intended the original code to do abreadth-first search it was doing a combination of depth and breadth. The functionality could also be implemented with a single loop. The result of the messages the resulting code from our communication is below.

Control FindControl(string target) {
    return FindControl(this,target);
static Control FindControl(Control root, string target){
    if(root.Name == target)
        return root;
    List currentLevel = new List<Control>() { root };
    while (currentLevel.Count > 0)
        Control match = currentLevel.FirstOrDefault(x => x.Name == target);
        if (match != null) return match;
        currentLevel = currentLevel.SelectMany(x => x.Controls.Cast<Control>()).ToList();
    }    return null;

System.ComponentModel.Win32Exception: The specified service has been marked for deletion

I was working on a project at work and had been informed that our code had been branced. I was moving over to the branch in which our ongoing work was to occur and started of with using installutil.exe to unregister a service that was part of the project.  When I looked back at the e-mail that listed which branch should be used for what I realized that the branch I was had been working in previously was the one that I needed to keep working in.  So I attempted to use installutil.exe to reregister the service. The registration failed.  I looked in teh install log and saw a nebulous error message.

"System.ComponentModel.Win32Exception: The specified service has been marked for deletion"

Unfortunatly that error message doesn't tell you what you need to do to resolve the problem.  But as it turns out if you had the services console open while you were unregistering the service this error message will occur.  To get around it you only need to close any service console windows that you have open.  After closing them I was able to reregister the service without any obstacles.

FindControl for Windows Forms

Some one asked a question in the Windows Mobile programming forums about dynamically finding a control at runtime.  When I saw the question the first solution that came to mind was Control.FindControl.  Before I suggested using that method I searched for the MSDN documentation on it and found that it only existed in ASP.Net.  It's missing from Windows Forms all together. So I put together a quick implementation of the function.

Control FindControl(string target )
    return FindControl(this, target);

static Control FindControl(Control root, string target)
        return root;
    for(var i=0;i<root.Controls.Count;++i)
        if (root.Controls[i].Name.Equals(target))
            return root.Controls[i];
    for(var i=0;i<root.Controls.Count;++i)
        Control result;
       for(var k=0;k<root.Controls[i].Controls.Count;++k)
           result = FindControl(root.Controls[i].Controls[k], target);
               return result;
    return null;

To use the function just define it on the root of the form in which you need the functionality.  If you cannot define it on a root form the then you can use the static version of it passing to the method a reference to a container of the control hierarchy in which you wish to search.  The function will recursively search deeper and deeper into the control hierarchy until it finds a UI object with the name specified or it will return null if no such object can be found.

DargonFire SDK: iPhone Development without Windows

Update 2010 April 21 :Change in Apple Developer EULA
I see a lot of traffic coming to this page (especially from forums.macrumors.com) so I decided to make one more update. Apple announced in their EULA for the 4.0 firmware that your iPhone executable must be written in objective-C and compiled with their compilers. The impact of this rule is some what ambiguous but it may mean that you cannot use any non-apple solution for development. This includes the Adobe Flash tools, Mono-Touch, and many others. From reading other pages that link to this page there seems to be an expectation that Apple should make a Windows Version of the iPhone SDK. I don't understand where such an expectation came from. Apple's always kept a pretty tight ecosystem and I can't see them making a change that would remove the requirement that any one wanting to make money off of their cash cow (the iPhone) not have to purchase Apple hardware.
Update 2009 Feb 15: More information on Dragonfire
I received a bit more information on the limitations of the SDK. From some one on the DragonFireSDK Team:
I wanted to let you know that the disadvantage you described in your article is strictly for our beta testers. Version 1.0 purchasers will have access to our Build Server where they can actually build their .app on one our our Mac servers. This will remove the "middle man".
More information on this can be found a http://dragonfiresdk.com/buildserver.htm
From looking at the page you can see that if you were to upload your program source an application deployment would be created and sent back to you.

A few days ago I made mention to the Dragon Fire SDK; an SDK said to allow one to develop for iPhone on their Windows Machine. I sent an e-mail requesting access to the SDK and promptly received a 571 Kb zip file said to contain the SDK. I thought it was unusually small. But I went through with following the instructions for compiling the sample application. After following all the instructions I ended up with a program running within an iPhone skin with a moving ball. I took a look at the output from Visual Studio and saw that it was an x86 formatted EXE. It made no sense to me, so I contacted DragonFire to ask how one was to get their application onto an iPhone.

The output was in fact a Windows executable. To produce an iPhone executable one would send their code to DragonFire and DragonFire would recompile it for the iPhone and send back the resulting file. If your iPhone is jail broken then you can install the application on your phone and run it. When you are ready to publish to the iPhone app store you would pay DragonFire a fee (I don't want to state the fee here other than saying it's lower than the cost to register for the iPhone app store) and DragonFire will compile the application and submit it on your behalf. The system is not as much a workaround as much as it is a workflow for those that don't have access to a Mac to do their own iPhone development.

Such a system has its merits and disadvantages. The obvious advantages are that one doesn't have to invest in a Macintosh if one doesn't already own one, the fees to be paid are lesser, and the registration process into the App store is taken care of. The disadvantage is now there is a middle-man that has access to your intelectual property and some one you must go through to for updates. Not to mention from Apple's perspective it is DragonFire and not you that is the publisher of the software. (updated. see text at top of page for explanation). A potential advantage or disadvantage is that instead of targetting the iPhone APIs directly you would be targeting a simplified API made by DragonFire. For those wanting to quickly put a program together this is good. But it also insulates you from many of the APIs available.

&quot;Spark Your Imagination&quot;

As I delve more deeply into mobile development I am considering changing my attention from Windows Mobile Professional to Windows CE  But wait, aren't those the same things?  No.

What's the Difference in Windows CE and Windows Mobile

Windows C.E. is a modular embedded operating system.  Developers using Windows CE can can select from a set of of modular components that meet their needs to configure a Windows CE image for their solution.  Windows Mobile is derived from Windows CE.  Windows Mobile is also modular in nature.  OEMs building a Windows Mobile device have a set of core functionality and components that must be installed and then can choose and select from a set of modular components.  They can also add features that don't exists in the Windows Mobile API.

I have several Windows Mobile devices running Windows 2003 SE, Windows Mobile 5 Professional, and Windows Mobile 6 Professional.  While these serve as nice testing hardware test devices the APIs available to them are more limited.  Windows CE has more potential flexibility.  Acquiring a Windows CE hardware testing platform will be easier than I thought it to be.  Microsoft has a program with their partners called Spark your Imagination to assist developers in acquiring CE hardware  for non-commercial projects.  Some of the features of the kits available through this program are

  • Professional-grade product at an affordable-grade product at an affordable price
  • Support for up to 32,000 simultaneous processes
  • 2 GB of virtual memory space for each process
  • Native real-time OS

I would like to purchase a kit promptly, but I will wait at least three weeks before making a decision so that I can make an informed decision.