Monthly Archives: July 2007

OLEAUT32.DLL and Windows Vista

4
Filed under Uncategorized

I’d been working quite happily with VB6 and Windows Vista for several days, when, this morning, I ran head long into a very disturbing problem

I had a class open, and was trying to enter:

Private myvar as Boolean

but as soon as I hit SPACE after the AS, long pause and CRASH.

Every time. Completely consistent.

Poking around in the Application Even log yielded this:

Faulting application vb6.exe, version 6.0.81.76, 
time stamp 0x3592011f, faulting module OLEAUT32.dll, 
version 6.0.6000.16386, time stamp 0x4549bd95, 
exception code 0xc0000006, fault offset 0x0000d921, 
process id 0x17e4, 
application start time 0x01c7cade79735543.

Which seems to clearly point at OLEAUT32.DLL and, I’d guess, the TypeLibrary loading and handling stuff that VB6 makes heavy use of for Intellisense purposes.

My first thought at this point was, holy crap! I’m gonna have to go back to XP to be able to get a stable VB6 environment!

I googled a bit and came up empty.

Then, I heard this voice in the back of my head (no, not those voices, one of the rational ones<g>) that suggested checking the SP level of VB6. Sure enough, I hadn’t installed SP6 (remember, I just repaved this machine a week or so ago).

Interestingly, MS’s update gizmo hadn’t suggested SP6 as an update. Guess their most popular language doesn’t rate high enough on the important scale.

At any rate, I installed SP6 and tried the same coding, worked perfectly.

Lesson of the day, always make sure you snag all the SPs when repaving.

Well, at least that’s one minor panic attack avoided!

Sony MicroVault as MultiBoot System Tool

7
Filed under Hardware, Utilities

With the success I had with getting a bootable image of MFSTools onto my old 1GB USB stick, why not go all out.

My local Fry’s has on sale Sony MicroVault USB sticks with a slide out connector.

image

I picked up a 4GB model for 37$ and am thinking a multi-boot setup with multiple partitions.

  • MFSTools, for all my Tivo adventures.
  • DOS6.2 with all my various boot tools, SpinRite, etc.
  • Ultimate Boot Disk, with various OpenSource DOS’s, plus some Linux stuff to, I believe.
  • A BartPE Windows XP boot partition.

Anything else that might seem useful?

Niceties about the USB boot disk option:

  • It’s fast
  • You don’t have a reburn a DVD to make a change to the configuration
  • The sizes are to a point now as to be actually useful

I probably won’t toss my trusty DOS 6.2 boot floppies just yet, ’cause some of my machines can’t boot to USB, but I suspect that will be changing over the next year or so.

GroupWise HTML File Attachments

1
Filed under Uncategorized

And now, from the world of unbelievably arcane email minutia, comes this:

In GroupWise 7.00, create a new message, enter some text and bold a few bits, thus making the message HTML format.

Now, add an attachment, say a bitmap.

And finally, add another attachment, this one an HTML file called Text.htm.

Don’t send, but rather, just close the mail window, at which point GroupWise asks if you want to save the draft. Save it to some folder.

Now, go to that folder and open the email. Your Text.htm attachment has evaporated! The other attachment should still be there.

Same thing happens if you were to just send the email, which is quite handy when the file you wanted to attach is actually called “Text.htm”.

Turns out, this would appear to be a bug in the way GroupWise handles attachments and HTM emails. Internally, they save the HTM body of the email as a FILE attachment called, you guessed it, TEXT.HTM. In some cases, as when you simply send the email directly, GroupWise properly HIDES that Text.htm attachment from attachment enumeration. But in other cases, such as when you open that saved draft message and send it, GroupWise fails to hide the attachment properly.

Which means that if you’re enumerating attachments in an outgoing GroupWise email, you need to be aware of that or you might end up processing the body of the email as if it were actually an attachment. That may or may not be something you want to do.

At least with Outlook, the HTML body of the email is flagged in such a way that it doesn’t show up when enumerating normal attachments. You have to go out of your way to retrieve the HTML or RTF body text of a message.

Gotta love those gremlins!

Setting Up IIS7 On a Vista Machine

0
Filed under Uncategorized

I’ve got Vista Ultimate running on my freshly paved machine, and I finally got to a point where I want to get all my .NET stuff back and operational.

I retrieved my website from VSS (fortunately, it was all checked in and up on my server), and went to setup the Virtual Directory in IIS. Where’s IIS?

Come to find out Vista doesn’t install it by default, but it’s easy to get.

Click Control Panel, Program and Features, then

image

Click the Turn Windows Features On or Off

Find IIS in the list and check it. You might also want to check the FTP server while you’re there, but it’s not absolutely necessary.

Once, it’s installed, you’ll find an “Internet Information Services Manager” item on your Administrative Tools menu.

image

With DotNetNuke, one of the first things you have to do is change the Default Document to include Default.ASPX, the option is highlighted above.

When I tried this, I got an “Access is denied” error. Grrrr. More Vista Access Control crap, I thought.

image

I spent almost an hour digging around for any settings in the IIS Manager that I might need to change to be able to make this pretty innocuous change to the website config. Nothing.

Then, I happened to think….Maybe it’s because I pulled all the files from VSS. When you do that, files are automatically marked READONLY.

A little experimenting later, and turns out, you need to make sure that WEB.CONFIG (in the root of your site’s virtual directory), is NOT READ ONLY.

Duh.

I have to say thought, that error message window could use just a tad more information. Even the name of the file with the problem (WEB.CONFIG) would have probably saved me an hour of digging.

Seems to me error dialogs like this ought to always have a “»more” button on them. Most people will never click it, and it’d keep the general UI light and fluffy. But when you need it, it’d be there.

Pie in the sky, I suppose.

Should Software Developers Know Hardware?

2
Filed under Hardware, VB Feng Shui

I’ve worked in a variety of positions over the years, including staffing up entire development departments.

One element I usually insist on in new hires is a reasonably solid foundation of knowledge of basic PC hardware and Windows setup (I’ve generally worked in Windows shops, hence the bias there). Things like hard drive setup, FDISK, formatting, all the way to assembling normal PC components (i.e. box of parts to a working PC).

Granted, these days, it’s not particularly cost effective to actually build out  developer machines this way, but it seems to me that generally speaking, developers ought to know their way around under the hood, maybe not at the circuit level, but at least the component level.

Is this expecting too much? Not enough? I could always wimp out and say that it all “depends on the situation.” But I’m not talking about specialized hardware or device drivers. I’m talking about general business applications.

Or have computers become more like commercial airliners or helicopters, where the pilots fly, the mechanics fix, and never the twain shall meet?

Blacked-Out Option Buttons

4
Filed under Uncategorized

Here’s an oldie but a goodie.

I hadn’t run into this in years, but here it was, making a nasty return.

Basically, if you’re running a VB6 application under Windows XP, and you have all the XP UI goodies turned on (the default), and your app contains option buttons directly sited within a Frame (pretty typical), the text of the option buttons will be blacked out by nasty black squares.

When I first ran into this, far too many years ago to mention, there was nothing about it anywhere. I remembered looking for several days for a solution before stumbling onto one.

Fortunately, there’s now a good KB article (KB936166) on the issue (though MS never fixed it).

Interestingly, as workarounds, the article offers:

Right-click the desktop, click Properties, click the Themes tab, and then select Windows Classic in the Theme list. Alternatively, click the Appearance tab in the Display Properties dialog box, and then click Windows Classic style in the Windows and buttons list.
Do not put option buttons inside frames.

While helpful, neither of these options would really do much to make my customers happy.

Fortunately, there is a third option:

Site your option buttons in a PictureBox (just set the background color appropriately and frame style to NONE) and then site the PictureBox on your frame.

Everyone’s a winner, and it’s not too terribly stomach-churn inducing.

Upgrading TIVO

0
Filed under Uncategorized

I’d been meaning to upgrade/backup my TIVO hard drive for ages now (it’s actually more than 4 years old, and has been running almost continually in that time).

The prospect was a tad daunting, esp after looking through the Hinsdale How to Guide. I’m not a huge Linux gearhead, but I can find my way around in a pinch. Still, at 26 pages, there’s a lot to absorb there.

In the end, after a good weekend of various false starts, I’m happy to say I now have a 370 hour Tivo with a nice, fresh, cool-running, ultra quiet Western Digital 320gb hard drive. And I was able to preserve all my existing recordings to boot! I probably should have taken the time to setup the FTP daemon or telnet access while the drive was out, but I’ve just run out of time for now.

However, for those considering attempting this, I thought I’d document a few of my false starts to hopefully keep you from traveling down those same paths.

First, the Hinsdale guide contains great info on removing the cover of the TIVO, removing the hard disk, what hard disks you might want to use to upgrade (I happen to prefer the newer Western Digital drives), and the commands you’ll need to move TIVO drive images around.

Also, I’m writing this from the standpoint of upgrading a single drive Tivo with a new, BIGGER single drive. If you’re dealing with a dual drive Tivo, or just want to add a second drive to your Tivo, this page probably won’t help you much.

Steps 1-6

These steps are all spot on and will get you to the point of having the TIVO drive in your PC. Make sure you have a bootable CD of MFSTools (or copy it to a bootable USB drive like I did).

Of course, having a whole step like:

Buy a Tivo

and

Buy a Torx Screwdriver

is a tad overkill, but at least they’re clear on the subject.

Step 7

This is all about making a short and sweet backup of your original TIVO disks. DO THIS!  A VERY IMPORTANT POINT TO NOTE is that when mounting your existing FAT32 drive (that you’ll use to write the backup to), they indicate to use the commands:

mkdir /mnt/dos
mount /dev/hda1 /mnt/dos

Take special note of that hda1. That’s hugely important! I accidentally entered /dev/hda (missed the “1”), and totally trashed the drive I wanted to use for the backup. I had to reformat it to get it back.

The backup command in Step 7 worked just fine for me, but be sure you attempt Step 8 (Restoring the MFSTools backup) before assuming it is a valid backup! See below.

The backup command I used (with a Series 2 TCD24004a Tivo) was:

mfsbackup -f 9999 -6so /mnt/dos/tivo.bak /dev/hdX

where X is the drive ID of the original Tivo drive you hooked up to your PC, typically “hdc” or “hda”.

FALSE START: I originally wanted to try performing the backup on a scratch drive I had lying around. Ie, backup and restore a scratch drive AS IF it was a Tivo original drive, just for practice.

Attempting to use MFSbackup on a non-Tivo drive will just end up giving you a read-block error, so that was no go from the start. Then, I came across the dd command a little later on in the backup section, so I tried it:

dd if=/dev/hda of=/dev/hdb bs=1024k

That ran for hours and hours and never completed. I stopped it after about 8 hours. One reason is that the “source” drive was a FAT32 formatted 120gb drive. Apparently, the dd command is very slow with large drives like that.

Step 8

As I mentioned above, you definitely want to verify that the backup actually worked. It failed once for me (because I didn’t get the command quite right), but it didn’t tell me it was a bad backup.

One point that the guide mentions and I’ll stress is to unmount (using umount -f -a -r) before rebooting and then powering off the machine.

You’ll want to test the restore of the quick backup using the command:

mfsrestore -r 4 -s 127 -bzpi /mnt/dos/tivo.bak /dev/hdX

where X is the letter of the NEW drive that will be going into your Tivo.

FALSE START: there is a paragraph in the guide that starts with “Note for those with already tested image” that basically indicates you should be able to perform a particular restore and automatically expand the Tivo in one shot, if you’ve already tested restoring the image. This didn’t work for me. The command they show to use is:

mfsrestore -s 127 -xzpi /mnt/dos/tivo.bak /dev/hdX

Note the missing -r 4 and the -xzpi instead of -bzpi.

I’m not sure what the difference is, but I do know that the Step 10 instructions below DID work properly.

Step 9

Put the new Tivo drive (that you just restored a backup onto), into the Tivo and try to boot it. This is just to verify that the backup and restore worked.

After working with PC’s so long, it’s a bit strange to work with a device that has no OFF button. To turn on the TIVO, you plug it in. To turn it off, you unplug it!

Step 10

I wanted to preserve setup and recording so I browsed through to the proper spot in Step 10.

Once I hooked the Original TIVO drive AND the new Upgrade Drive (had to take it back out of the Tivo box from Step 9), I rebooted to MFSTools and used this command:

mfsbackup -Tao - /dev/hdX | mfsrestore -r 4 -s 127 -xzpi - /dev/hdY

where X is the letter of the original TIVO drive and Y is the letter of the new Upgrade drive.

Note that the -r 4 is here from the part of Step 8 above that worked. I’m not sure of the difference between -xzpi and -bzpi. ANy ideas?

This command took a LONG time (for a 40hr Tivo, it took about 8 hours), but it does show progress (unlike the dd command), so I knew it was working the whole time).

FALSE START: I thought it might be good to grab a backup of the WHOLE Tivo drive and then restore that, so I tried this command, after remounting my FAT32 disk I was using to save backups:

mfsbackup -Tao /mnt/dos/all.bak /dev/hdX

It ran for a while but then failed for no apparent reason. I probably just don’t have the flags right, but it was 12:30am, so things were getting bleary.

Summing up…

In the end, the single step backup from original disk->restore to new disk worked just fine. Put it back in the Tivo, booted, and now I have plenty of space for Sesame Street and Stargate.

When is a not Dead UPS, in fact, Dead

4
Filed under Hardware

If you’ve spent any time at all on computers, you’re bound to know the frustration of working along, minding you’re own business and getting tons done when, blip, the lights go out for quarter second you’re staring at a black screen, trying to remember what exactly that last idea was that would save the world from destruction, if only you’d been able to write it up first.

A good UPS (Uninteruptable Power Source) can all but alleviate those problems.

But don’t do what I did. I was short on cash the last time this came up, so I picked up a Best Buy special for about 60$, a CyberPower 525SL for my server. Before that, I picked up a Belkin UPS for my workstation.

They worked ok, for a bit. But we got a power flicker yesterday that sent both machines into the black within about 2 seconds. And right at a most inopportune moment. My wife’s PC, on an older APC, never even noticed.

A UPS is one of those things that I almost hate spending money on. The batteries never seem last very long. They can’t be environmentally friendly, and yet you pretty much are guaranteed to throw them out on a regular basis.

But, I hate losing work too.

A little google research later and I’m off to Office Depot to pick up an APC XS1300. 178$ after tax. Big double sealed, hot swappable lead acid battery putting out 1300va for 780 watts. Very cool red LCD screen.

image Here’s a shot of the typical incoming voltage level.
image But here’s the interesting shot. That’s the current load, in watts. Pretty slick. Don’t even need a KillaWatt to measure.

My server reads about 107 watts on average, which surprised me a little because of the 1.5.gb ram, but mainly because of the 4 RAID drives, plus boot drive, plus an extra drive.

My new rules on UPS’s:

  • Make sure it has an easy to swap out battery. This APC’s is hot swappable, and requires no tools to get at. Looks like most APC batteries are hot swappable. The CyberPower and Belkin? Fugettabowdit.
  • Make sure it’s big enough to give you some lead time. Minimum 600 watts for today big Core 2 Duo rigs.
  • Make sure it speaks USB. Serial ports are a rare thing on modern MOBO’s and the chat between UPS and machine is pretty handy for shutting things down intelligently when you aren’t around.
  • Don’t even think about those el cheapo sub 100$ units unless it’s going under a TV or a cordless phone base station. Just the fact that replacing the battery requires tools and time should be the clue there. Wish I’d spent the money way back when.

Any good UPS horror stories out there?

BOOTMGR is missing

2
Filed under Hardware, Troubleshooting

So I’m getting all set to upgrade my TIVO harddisk. I’ve downloaded and burned MFSTools, gathered all the various bits together, etc.

I thought, Hey, it’d be a good idea to try this out on a scratch HD first, just to make sure I know what I’m getting into.

So I grabbed an old 120GB drive, swapped it into my machine, and was going to reformat it as FAT32 and copy a few files on it, so act as a surrogate TIVO drive.

I swapped the drive in, restart the machine….

BOOTMGR is missing

Huh!??????

After some panicked Googling from my server, I discover that Vista has a nasty habit of writing the BootMgr sector to the “first” HD in the drive sequence according to how your BIOS is configured at the time you install Vista.

In my machine, the RAID comes pretty late in the boot sequence, so apparently, my spare 320gb drive that I was intending to use in my TIVO inadvertently picked up the Vista boot manager.

To avoid this whole mess in the first place, make sure when you install Vista, the ONLY HD that’s installed is the one you’re installing Vista onto.

However, if you’re like me, that’s not much of an option. Which leads to solution #2:

  1. Shut the machine down.
  2. Disconnect any “other” hd’s (other than the one that has Vista installed). If you’ve got a RAID, leave only those drives in the RAID connected.
  3. Find your Vista Boot DVD
  4. Put it in and restart, boot to the DVD.
  5. The Vista installer will start up and ask if you want to install in English, etc. Click Next. This won’t actually start installing Vista.
  6. The next screen, towards the bottom, has a “Repair your computer” option. Click it.
  7. Click the operating system installation (there’s likely only the one Vista installation listed). Click next
  8. In the System Recovery Options dialog, click Startup Repair.
  9. Restart the computer.

Worked for me.

Formatting FAT32 Under Vista

0
Filed under Uncategorized

I needed to format a 120GB disk to FAT32 to run a few trial runs with MFSTOOLS for upgrading a TIVO unit with a bigger harddisk. You’ll also run into this, though, if you need to format a USB key, or removable harddisk as FAT32 (so it would be compatible with Linux or a Mac).

You can’t format at drive/partition with FAT32 format greater than 32GB under Vista.

Microsoft has apparently just put an arbitrary limit in the formatting routines.

Not only that, you can’t format FAT32 at all via the GUI, as far as I can tell. The drop down list for format type only shows NTFS.

You CAN format in FAT32 by opening a command prompt as administrator and running

Format {drive} /FS:FAT32

But that’s still limited to 32GB partitions.

I did find a couple of solutions, though.

The first is a freeware command line utility from RidgeCrop Consultants called fat32format.

The second is a GUI utility (but that’s putting it nicely) called Flash HD to GO!, for formatting USB keys, but it appears to work with any media.

They both seem to work just fine under Vista for formatting an actual harddisk (in my case a 120GB Seagate).

I will admit though, the Flash HD to Go utility can be a little nerve wracking to run, with it’s decidedly sparse UI and limited warnings and information about the drive that’s about to go bye bye.