WinCE development without Active Sync on Win 7

At the start of the year I was given a device to do trial Windows CE development against. I was also given a zip file with the SDK and some instructions.

Step 1: Install Active Sync 4.5 on your Windows XP machine (this will not work on Vista or Win 7)

So my Win 7 lappy is shafted. Luckily some work colleagues had been doing WinCE development ‘differently’ on an earlier product, and they mentioned using ‘CMaccept.exe’.

Search for ‘CMaccept.exe’ leads you to the advice you want: How to: Connect to Windows CE Device Without ActiveSync

Luckily for me my device has working Ethernet, so this worked nicely.

I mention this because today another engineer asked me how I got Active Sync working on the device, as he’s having problems under XP, thus I suggested the above method.

Post VS2010 SP1 Updates Issue

Since installing the Service Pack 1 for Visual Studio 2010, my .sln files for Visual Studio 2005 have not been opening.

This turns out to be, because I had VS2005 set to need Admin Privileges to run, to allow some remote debugging. But I also needed to set this for the Visual Studio Launcher, as this is what chooses which Visual Studio to open the solution file. In applying the service pack, it appears the need Admin Privileges setting was lost.

To test this, I found the VS2005 executable and remove the Admin Privileges requirement, and then my 2005 solutions opened.

But I couldn’t find where the Launcher was, so searching registry for .sln I found the file uses:

VisualStudio.Launcher.sln

looking for this you find it at:

HKEY_CLASSES_ROOT\VisualStudio.Launcher.sln\Shell\Open\Command

which for my machine points to:

C:\Program Files (x86)\Common Files\Microsoft Shared\MSEnv\VSLauncher.exe

Now knowing the Launchers name/location I can set needs Admin Privileges and everything works as it was.

WinCE SDK problems in Windows 7

For the last few weeks, my work project has not been building it’s WinCE target on my new Windows 7 PC. Each project would just say “skipping build”,

12>------ Skipped Build: Project: PROJECT_NAME_12 ------
12>
13>------ Skipped Build: Project: PROJECT_NAME_13 ------
13>
========== Build: 0 succeeded or up-to-date, 0 failed, 13 skipped ==========

and if I tried to edit the project properties (or build/clean/rebuild project only), I would get

The operation could not be completed

It then dawned on my to try a new project test, and the SDK was missing from the options:

A bit of focused searching found Windows CE: SDK Doesn’t Show up in Visual Studio 2008 post, and the solution worked for me with my Visual Studio 2005 SDK under Windows 7 also:

  1. Make sure Visual Studio 2005is not running. I also shut down the device emulator manager but you may not be using that
  2. Open a “Visual Studio 2005 Command Prompt” as Administrator. On Windows 7 just right click the short cut and pick the “Run as administrator” option
  3. Enter the following command: msiexec /package <the path to your .msi file>
  4. Install

You need to used the same steps above to uninstall the SDK as well (as compared to the Control Panel’s ‘Programs and Features’ options), otherwise it won’t uninstall correctly.

Book: Lex & Yacc

I picked up a copy of Lex & Yacc off TradeMe the yesterday, and I’m quite excited.

I’m hoping it will help me get my head around parser writing, for my still to-be revealed side project…

For a while now I have been working on a side project to add editor support for Erlang in Visual Studio.

I have a Google Code project for it, and it currently has syntax colour highlighting, but I was getting stuck with writing othe parser.

This is where the project has stalled over the last few months as I have been reading lots.

Originally I was basing my work on Lua Langage Pack for Visual Sudio. This package is a C# based plug-in that uses the CSTools project by Malcolm Crowe.

With the help of Code Project documents, MSDN and Blogs I slowly got a plug-in that has colour highlighting working (if you run it in the debug Visual Studio).

I was also reviewing how the IronPython project does it’s parser, but that used seemed to use python to do some parsing.. so

I then was trying to get Antlr to work, via AntlrWorks, but was banging my head on the debuggers limited support.

The next problem was how do I actually define the grammar for Erlang.

Erlang ships with a  grammar defined in yecc, it’s version-thing of yacc.  So I started translating this to Antrl but was getting left-right recursion errors, even though the problem was not the standard definition of left-right recursion problem.  Yecc is recursive decent as Erlang does recursion so well, but this was not playing well with Antlr. I then discovered I was looking at a subset of the Erlang gramma, and the full yecc gramma was huge, so hand translations was not an option.

So I then found the yecc grammar for yecc, and thought that I could hand roll a C# recursive decent parser for yecc, which would allow the auto-writing of a proper grammar for CSTools. But I wasn’t so keen on the .dll dependency of that tool chain.

I started reading the dragon book (Compilers: Principles, Techniques, and Tools) around this time, so was starting to get my head a little better positioned.

I then stumbled on to the Irony project which is a Visual Studio language development framework.  Eek they have most of what I was trying to workout how to-do, mostly worked out. But they have their own lex and yacc like tools.  This project also refers to the Visual Studio’s lex and yacc tools called MPLex and MPPG (distributed in the Visual Studio SDK)

I have just found that the newer version of the Lua project for Visual Studio 2008 uses the Irony project, and is hosted on CodePlex.

So I was getting keen again to work out how to use lex and yacc correctly, thus why when I saw this book for $3, I bid and anxiously waited to se if I’d win.  Of the 19 counted page view on the auction, 17 were mine.

So I’m half way through the first chapter and have just realised I don’t need to write a hand parser of yecc, I just need to write a lex parser that translates yecc to yacc, and rebuild that with MPPG to get a C# Erlang parser that is not hand rolled. Which means if the Erlang language changes, I can just re-run the whole process on the new gramma, and still be compliant.

Installing Visual Studio 2008

I have finished now, but I have to say there was something creepy about the two male photos used. One looked too happy and the other too smooth.  What made it worse was that it kept changing and my attention would be pulled to smug guy or happy guy.

Visual Studio 2008 - Happy Guy Visual Studio 2008 - Smooth Guy

I’m not looking forward to having to do a repair, luckily I did a full install, so there are no extra features that I will have to install later……