Help! We’re running a VB3 app and we’ve lost the code

I write a programming column for Personal Computer World. A reader contacted me with a problem. He had an application which he knew was written in Visual Basic 3, but for which he did not have the source code. He now wanted to adapt it to run on Windows Mobile.

VB 3.0 came out in 1993, a mere 15 years ago but an eternity in Internet time. It was hugely popular, partly because it included the JET database engine, the same one as used by Microsoft Access. Both professionals and keen amateurs used it to create little (and not so little) business apps. VB 3.0 is 16-bit, and although these apps may still run OK on Windows XP or Vista 32-bit, though perhaps with a few cosmetic glitches, they will not run on 64-bit Windows, which has no 16-bit emulation layer.

Not many organizations are moving to 64-bit desktops just yet, though they may well do so in a couple of years, but there is still a problem if you need to adapt or port the code.

I thought this would make a fun case study so I wrote it up in the May 2008 column. I tracked down the VB3 decompiler put out some years back by Hans-Peter Diettrich, also known as Dodi. He gave me a demo version to distribute to readers. The app in question turned out to be very simple, and decompiled easily. I then imported the project into VB 6 (because later versions won’t look at VB3 apps), and finally pulled the VB6 conversion into Visual Studio 2008. Once I’d fixed up the Windows version, I created a new Compact Framework solution into which I copied code from the desktop project. Much of the code made it all the way from the VB3 original to the Compact Framework, and ran fine on my IPAQ Pocket PC.

Working with decompiled code is a bit like solving a crossword puzzle. Variable names are mangled so you have to work out what they are for. It won’t be a quick and easy process except in the simplest of cases.

The incident makes me wonder: how many business-critical apps with lost source are out there? Someone posted a cartoon recently which I can’t now track down, but it was a graveside scene. One mourner says to another, “I’m sorry to ask at a time like this, but did he say anything about source code?”

How hard can it be to play an AVI file?

It depends. I saw Matt Mullenweg’s post about new features in WordPress 2.5. He’s included a video in several formats, and since the embedded Flash version didn’t want to play (maybe bandwidth issues), I downloaded the AVI and double-clicked. Windows Media Player tried to play it, said it was acquiring the codec, and then played only the audio. This is what I got when I looked at properties:

Did Mullenweg include restrictive DRM on his promo for the next WordPress? Unlikely. I right-clicked and chose to open in QuickTime. QuickTime said I needed some new components to play the file, and directed me here – but without telling me which of the 10 downloads on offer might fix the problem.

I right-clicked again and chose VLC. Perfect playback. But I was intrigued. I looked at the Stream and Media info in VLC and found that the video codec was TSCC. I looked this up and found it here. It is the TechSmith screen recording codec. I downloaded and installed the TSCC codec (ignoring Vista’s insistence that it “did not install correctly”) and now the file plays fine in both WMP and QuickTime.

Still, I have a couple of questions. If TSCC is a reasonably well-known codec, how come these players are not smart enough to direct users to the right download, or at least display the name of the codec to make it a little easier to find?

Second, why does WMP think media usage rights are missing? More Windows DRM madness.

Note: the problem with AVI is that it is just a way of bundling audio and video into one file. There are many possible formats for the internal streams, so just because one AVI file plays OK, it doesn’t mean that another will. Hassles like this are one of the reasons Flash video is so popular.

Small Business Server 2008: no ISA Server, no built-in tape backup

I have caught up a little with what is coming in Small Business Server 2008, code-named Cougar. Short version: Microsoft is focusing on ease of use but omitting some of the features that made previous versions attractive. This will be an upgrade headache if you used those features.

The new version is 64-bit only and includes Exchange Server 2007, Sharepoint Services 3.0 and WSUS (Windows Server Update Services) 3.0 as standard. Go Premium to get SQL Server 2008 and a license for a second server (which can be 32-bit).

Program Manager Sean Daniel says in an interview (video) that the install is easier than before, and that wizards are scenario-based rather than task-based. I think this means that more decisions are taken for you. However, two changes have caused some consternation.

The first is that tape backup is no longer built in. The new backup system only supports external USB or FireWire drives. I’m not sure about backup over the network; it would be silly to omit this, but who knows? It is based on differential backup, which means you can backup in 10 minutes and do it every hour if you like.

Microsoft says this is because external drives are cheaper than tapes, and that most SBS users have moved to hard drive backup in any case. This is true unless you have a lot of tapes. However, tape advocates point out that tapes are more robust in transit and safer for archiving. Personally I’ve had problems with the cheapest bus-powered external drives, mainly because of the power being inadequate, but I’d hope that up-to-date hardware fixes this. If you still love tape, the solution is to buy a third-party tape backup system.

The other big omission is ISA Server, Microsoft’s firewall and proxy server. This is a bigger deal. ISA is a complex but sophisticated product that requires two network cards to be installed. If you can work out how to administer it, it provides extra security in conjunction with an external firewall, and numerous features for publishing internal servers and services. Why has it been dropped? Daniel makes a curious comment in this Q&A:

I am as disappointed as you with this. Certain circumstances with the changes in Longhorn server left us without firewall solution in our standard product. We attempted to move ISA into the standard product, but legal issues prevented this. There was nothing we could do.

Legal issues? This is a Microsoft product bundled with a Microsoft product. I wonder if he means internal politics?

In particular, note that there is a new multi-server bundle called Windows Essential Business Server 2008, which does include ISA.

So what do you do if you have a full-works, dual-NIC SBS 2003 box and want to upgrade? There’s no in-place upgrade, because this is 32-bit to 64-bit; and the disappearance of ISA means you have to rethink your network architecture, or upgrade to the aforementioned EBS.

Two things disappoint me here. One is that Microsoft is pushing small businesses towards multiple servers, in SBS Premium or EBS. Although this has administrative advantages, it’s not very green, it’s losing the essence of what SBS was about, and seems out of tune with the more general industry move towards fewer servers and virtualization.

The second disappointment is that Microsoft seems to be pretty much ignoring the cloud. I may be wrong: the blurb says “Integration with Microsoft Office Live Services Small Business”, though I’m not sure what this amounts to. Personally I reckon the cloud is the future for the niche that SBS fills. I’d design SBS Next as a local cache for cloud services.

Windows 7 rumoured to have new UI framework with Ribbon and Jewel

Not sure what to make of this. A number of sites are reporting on a Microsoft job posting which includes the following text:

Come lead the effort to update the Windows 7 platform with the latest advancements in User Interface design. Bring the Ribbon, Jewel, and other new UI concepts to the Windows platform … Our mission is to enable the next generation of user interface development on the Windows platform. We will be determining the new Windows user interface guidelines and building a platform that supports it. We’ll eliminate much of the drudgery of Win32 UI development and enable rich, graphical, animated user interface by using markup based UI and a small, high performance, native code runtime … The UI Platform Team is looking for a senior technical leader to help drive the design and implementation of the new UI framework.

The posting appears to have been pulled, which means I can’t verify that it ever existed. Still, it’s thought-provoking. The “Jewel”, by the way, is the big button at top left of Office 2007 apps – the one you have to click when in search of the File menu.

I get on OK with the ribbon in Office 2007, but it has annoyances. For example, in Excel, why is Insert Cells and Rows on the Home ribbon but not on the Insert ribbon? I tolerate it because of the Quick Access Toolbar which lets me group the commands I often use but can’t find easily.

Even so, there’s no harm in making the ribbon a first-class citizen in Windows. But what about this new “markup based UI” and “small, high performance, native code runtime”? It is hard to believe that Microsoft would abandon WPF, which is already a markup-based UI. Might this be a new WPF runtime that does not require .NET? This may seem plausible if you recall that early versions of Longhorn attempted to use .NET for the core Windows UI, a mistaken decision that was a factor in the infamous reset, and thus indirectly caused Vista to be delivered both late and unready.

It still makes little sense. Microsoft already has a small, high-performance, alternative WPF runtime: Silverlight. Why build another one? Further, Windows needs simplification, not new frameworks. It also seems late in the day to be contemplating the “design and implementation” of a new UI framework. Perhaps it is just an early April Fool; or maybe plans are further along than the posting implies.

Technorati tags: , , , ,

Now it’s Eclipse that has “baroque” code

This provoked a wry smile, from a Reg Dev article on the forthcoming Eclipse 4:

Underpinning all this, though, is an attempt to escape the “baroque” 3.x codebase for something that’s simple, clean and modular. That means eliminating repetition in code and interdependencies found in the monolithic 3.x.

“It’s getting to the point where it’s difficult to reach in and fix a bug without impacting lots of other things,” one e4 committer told EclipseCon.

Now, Eclipse is a child of the refactoring era. It is built using an MVC (Model-View-Controller), component-based, plug-in architecture. Design patterns guru Erich Gamma worked on Eclipse and on its Java Development Tools.

If Eclipse is now a ball of spaghetti, what went wrong? Though its possible the problems are being over-stated in an effort to justify version 4.

Technorati tags: , , , ,

Introspective QCon asks hard questions about Java, SOA, REST

Last week I attended QCon in London and have been mulling over the experience. Two themes stood out for me, though bear in mind that having recently attended Adobe and Microsoft events, I avoided the sessions which related to those companies and focused on Java and more general issues.

The first was the extent to which QCon accepted that mistakes made in the early years of J2EE have been costly for the industry. In this respect the key speech was from Spring inventor Rod Johnson, whose session was called The Cathedral, The Bazaar and the Commissar, “an opinionated view of the story of Enterprise Java innovation.” Johnson stated that the rush to standardize everything in the Java platform had done almost as much harm as good (though he did say it was a “net positive”). He identified numerous problems in the standardization process. In particular:

  • The expert groups are dominated by large vendors whose interests are not aligned with those of developers. Johnson gave the example of JDO. “What happened was, this was intensely political. Database vendors hated JDO. Application server vendors hated JDO. Because in each case it wasn’t good for their business. And the result was that JDO was indeed taken out and shot.”  Johnson also noted that J2EE serves to protect the existing licensees:

“It pretty much ensures that there will be no competition, because who at this point would want to implement the whole enchilada of J2EE?”

  • The JCP has a history of ignoring prior art, which means on occasion it comes up with specifications that duplicate the functionality of existing products, or which are inferior to what is already available. In consequence good technology that was outside the JCP was lost. He cited O/R mapping, persistence and logging as examples. Here’s Johnson on Toplink:

“Hibernate is the de-facto standard for O/R mapping today. It’s a pretty good product. How many things does it do that TopLink didn’t do in 1998? The answer is not many. There’s probably just as many things that TopLink did in 1998 that Hibernate doesn’t do now. Toplink wasn’t as robust back in those days. But … what we’ve done is somehow managed to kill all innovation for ten years in O/R mapping, while in the meantime Microsoft has both figured out that O/R mapping is interesting and with new technologies like LINQ they’ve actually started to push the envelope. They shouldn’t be relevant in this space because there was such a lead in terms of Java technologies.”

  • The JCP standardized specifications that did not work, in particular Entity Java Beans. The industry accepted them because there was an obsession with standards. “There was a complete transformation where non-standard technologies could no longer compete and competition was no longer on merit.”

Johnson asked what seems to me to be a key question: what should be standardized? He said that it is silly to try both to innovate and to standardize at the same time, because the committee will get it wrong. You should standardize in areas that are well known, understood, and proven in the market.

Despite appearances, Johnson is not an enemy of the JCP. He spoke warmly of the current chairman, Patrick Curran, who is trying to reform the organization; and feels that real progress is being made. Curran was also at QCon seeking opinions on the JCP and its future.

Johnson also feels that Java has moved on. “The Java world is no longer a one-party state,” he said.

What I found interesting was that everyone at QCon seemed to agree with what Johnson said. Even Curran did not try to dispute it. In the closing panel, Martin Fowler from Thoughtworks introduced Johnson as “the man who single-handedly destroyed EJB”, and was applauded.

I suspect there is a Microsoft factor in all this. In the early days of Java, there was huge fear that Microsoft would corrupt Java and make it a Windows-only technology. Standards would prevent this happening; hence the standards religion that Johnson claims was not thought through.

There is an interesting underlying issue here, which the extent to which our industry meekly follows the lead of influential gurus and big vendors in the solutions which it implements.

That brings me to the second major theme which I noticed at QCon: the rise of REST. Despite sincere attempts at balance, there was an unmistakable tendency to promote REST at the expense of other stuff including WSDL and SOA. In many ways this makes sense to me, but it would be rash to assume that this year’s fashion is immune from the issues that now beset fashions from previous years. One delegate asked what stuck me an an excellent question in the closing session:

“What if you came along last year and saw the rise of SOA, and perhaps went off and did a whole load of SOA, and came back this year and found, SOA is on its way out, I should have done loads of REST stuff – how are we supposed to recognize which are the good horses to back?”

It is this kind of fear that leads many senior IT folk to be conservative in their technology and vendor choices.

Technorati tags: , , , , , , ,

Ugly Flash: auto-play audio with no stop button

Today I was transcribing parts of an interview when the phone rang. It was a call about Dreamforce Europe, the conference in early May. I navigated to the event site to check out the agenda. Suddenly there was a cacophony of noise. At first I thought my interview, which I’d paused in order to take the call, had somehow restarted; but then I realised it wasn’t that, it was a Flash video (with sound) on the Dreamforce site. I can see no pause or stop button; and the right-click menu doesn’t have one either. The problem was made worse by a bandwidth issue; the audio was breaking up, making it unintelligible.

A horrible user experience and poor web design. Audio is even more intrusive than video. Personally I dislike any audio that auto-starts when you visit a page; if there is no obvious way to stop it, other than by leaving, it is inexpressibly ugly.


I received an email from PR, saying that there is now both a pause and a mute button on the Flash movie. It’s true: bottom right of the panel. Well done for fixing this.

XBox 360: nearly great

Unhappily, I have joined the ranks of those who have suffered more than once from the XBox 360 red lights of death. It’s a known design fault, so hardly surprising, but annoying none the less. Mine was a launch console, and lasted over a year before succumbing. Ten months later, and it’s failed again. I don’t blame the repairer; it’s even a different error code (0103 vs 0020).

The 360 story resembles that of a Greek hero: great, but tragically flawed. I love the console and would hate to be without it. Pre-launch, there was much debate about whether a narrow disadvantage to the PlayStation 3 in graphic power would damage it; Microsoft said that the quality of the software was more important, and has proved its point. Few complain about the 360’s graphics. There are plenty of high-quality games; XBox Live is a strong service; the downloadable arcade games are compelling and good value; it does a decent job as a media center; it has the best wireless controller; and now you can even purchase movies through XBox Live.

But the flaws. Most notably, the fact that you know the thing will fail prematurely. Well, the current crop is said to be better, but how much better? It is unknown, though I guess I’ll find out because I’ve just gone out and bought an Elite at the new reduced price, tempted by HDMI, a larger hard drive, and the hope of longer intervals between red illuminations. Good money after bad? Not really, because the console has delivered value. It is just flawed, that’s all.

There’s also the noise of the fans and DVD drive, and I must mention a third problem, which has caused me some aggravation. This concerns the DRM. If you purchase a game from Live Arcade, it is fully unlocked for all the profiles on that console. However, if the console breaks and is replaced, and you re-download the game, it is only unlocked for the profile which made the purchase. Sounds a small point; but if you replace your console and have a family member who enjoyed playing a particular game under their own profile, it is annoying to find that it is now only a trial.

I thought I should check my facts, so I called Microsoft’s customer service and asked if I could transfer the licenses from my doorstop (formerly a 360 Premium) to the new Elite. No, I was told, the games were tied to the doorstop. Rubbing salt into the wound, the service representative said she would have helped, but I had violated my terms of use by tampering with the machine. In other words, it was my fault.

My crime, it turns out, was in sending my 360 (which failed before Microsoft extended its warranty to three years) to a third-party for repair. Not only did this void the (then-expired) warranty; it also meant that Microsoft would not help me recover the full rights to my purchased games.

I am sceptical about how much difference this actually made, since my understanding is that Microsoft never transfers licenses to those upgrading to an Elite.

Fortunately there is a workaround, discovered not from customer service but from my own research. If you have several controllers, it is possible for each controller to be signed in under a different account. Just press the XBox button on the controller and select a profile. Provided that one controller is signed in as the profile which made the purchase, other profiles can play the unlocked arcade game. Not ideal, but better than nothing.

It is interesting to speculate just how much the 360’s quality problems have cost Microsoft. There is the cost of constantly and repeatedly fixing consoles; even more serious are the sales lost to those reluctant to purchase a machine likely to break prematurely. I would likely be one of them, except there is a row of 360 games on the shelf. It’s called lock-in.

We like the Elite. The graphics seem a little better; it is quieter and even feels slightly more responsive than the old box. A great console. But flawed.

Technorati tags: , , ,