Monthly Archives: July 2010

The Antec Sonata Case

0
Filed under Hardware

image I’ve always been impressed by Antec cases, and the Sonata I just picked up for my NAS box is definitely no exception.

First, it’s packed well.

It came with a bag STUFFED to the gills with screws, knobs etc. way more than you’d ever actually need.

imageI needed some drive rails to mount a CDRom. Hmm. Didn’t have any right off hand, but lookee here, right behind the 5.25 drive bay cover…

Unbelievable. Rails clipped in behind it!

Plus, Antec uses silicone vibration isolation washers for their harddrive mounts, and special screws for that. Good stuff.

The Sonata is not quite as nice as the P182image

but it’s cheaper and smaller, so it fits the bill better for a NAS box with 2 drives in it and not a lot else.

NAS’s, The Gigabyte M68M-S2P Motherboard and gigabit Lan Ethernet speed

0
Filed under Hardware, Networking, Windows 7

One small element of replacing all my equipment damaged by a lightning strike was to figure out what to do about my NAS.

image I’d picked up a sweet little Iomega StorCenter 1TB NAS server about 4 years back and it had served me well (despite having Seagate drives in it, ack!). But, after the strike, it was toast. What to do?

My first inclination was to just replace it. The Iomega units tend to be a little on the pricy side and Fry’s had a sale on Western Digital NAS boxes, so what the heck. I picked up a My World Book II, 2TB (Dual 1TB drives) box and came on home.image

Brought it up, restored my backup and all was well. Till a few hours later. The NAS just dropped off the network. I could still ping it, but couldn’t browse to it, connect via mapped driver letter, or anything else.

I powered the box down, and brought it back up, and all was well, for a few more hours. Then, same problem.

After far too long on the phone with WD’s tech support, I wrapped it up and took it back. After a few more false starts, I eventually decided that, heck, for the cost of 2 2TB drives, an Antec Sonata case, some ram, a Motherboard and CPU, and an OS, I could just BUILD a NAS box for about the same money.

imageSo off I went. Settled for the Gigabyte M68M-S2P motherboard with an AMD Athlon 64 X3 tricore. Pretty smooth sailing. Got the box running, hooked it up to the network, and then started copying files over to it.

SSSSSSLLLLLOOOOOOWWWWWW……

What the heck!?

Checked the network adapter and it was auto negotiating at 10mbps! This is the onboard gigabit Ethernet port on the Gigabyte board. Googling came up with a number of people having similar problems but no solutions.

I tried downloading new drivers, installing WinXP 64, and Win7 64, you name it. I could never get the drivers to negotiate at 1gbps.

Finally, I happened to be in the Device Manager, and right clicked on the NVidia nForce Ethernet controller (again, I’d done this plenty of times!)

image

I right clicked it, selected UPDATE DRIVER SOFTWARE, then clicked BROWSE MY COMPUTER FOR SOFTWARE.

Then, clicked LET ME PICK FROM A LIST OF DEVICE DRIVERS ON MY COMPUTER.

Lo and behold, I get this:

image

The NVidia drivers were selected, since I’d installed them off the CD that came with the motherboard, BUT there was that “Microsoft” set of drivers. I selected it, let it install and rebooted.

Presto, the magic 1gbps connection speed!

image

VSTO 3 in Visual Studio 2008 under Office 2010

5
Filed under Office, Tweaks

Ok, bit of a weird combination. If you’re developing for Office 2010, you’re using VS2010, right? Uh huh…

Seriously, if you’re like a lot of folks, you might not be upgrading to VS2010 soon, so Microsoft can shake the bugs out in an SP1. But still, you have an Office VSTO addin in VS2008, that you’d like to be able to run in Office 2010, while debugging in the VS IDE.

If you’ve tried this without having Office 2007 installed ALSO along with the Office 2007 Primary Interops, you’ve most likely gotten a nasty message in the errors window telling you you “can’t compile this application because Office 2007 is not installed” or some such.

Well, fear not. With a little tweak to your addin’s project file, you should be good as gravy.

Here’s the untouched section from towards the bottom of a VSTO VBProj file. Notice the nasty line that starts with “VSTO_COMPATIBLEPRODUCTS”.

  <!-- This section defines VSTO properties that describe the host-changeable project properties. -->
  <ProjectExtensions>
    <VisualStudio>
      <FlavorProperties GUID="{BAA0C2D2-18E2-41B9-852F-F413020CAA33}">
        <ProjectProperties HostName="Word" HostPackage="{D2B20FF5-A6E5-47E1-90E8-463C6860CB05}" OfficeVersion="12.0" VstxVersion="3.0" ApplicationType="Word" Language="vb" TemplatesPath="" DebugInfoExeName="#Software\Microsoft\Office\12.0\Word\InstallRoot\Path#WINWORD.EXE" DebugInfoCommandLine="/w" AddItemTemplatesGuid="{2606E7C9-5071-4B63-9A83-C66A32B1669F}" />
        <Host Name="Word" IconIndex="0">
          <HostItem Name="MyAddin" Code="Connect.vb" CanonicalName="AddIn" CanActivate="false" IconIndex="1" Blueprint="Connect.Designer.xml" GeneratedCode="Connect.Designer.vb" />
        </Host>
        <ProjectClient>
          <VSTO_CompatibleProducts ErrorProduct="This project requires Microsoft Office Word 2007, but this application is not installed." ErrorPIA="This project references the primary interop assembly for Microsoft Office Word 2007, but this primary interop assembly is not installed.">
            <Product Code="{XX12XXXX-XXXX-XXXX-X000-X000000FF1CE}" Feature="WORDFiles" PIAFeature="WORD_PIA" />
          </VSTO_CompatibleProducts>
        </ProjectClient>
      </FlavorProperties>
    </VisualStudio>
  </ProjectExtensions>

The trick, it turns out, is to just comment that element out completely.

You’ll end up with this…

  <!-- This section defines VSTO properties that describe the host-changeable project properties. -->
  <ProjectExtensions>
    <VisualStudio>
      <FlavorProperties GUID="{BAA0C2D2-18E2-41B9-852F-F413020CAA33}">
        <ProjectProperties HostName="Word" HostPackage="{D2B20FF5-A6E5-47E1-90E8-463C6860CB05}" OfficeVersion="12.0" VstxVersion="3.0" ApplicationType="Word" Language="vb" TemplatesPath="" DebugInfoExeName="#Software\Microsoft\Office\12.0\Word\InstallRoot\Path#WINWORD.EXE" DebugInfoCommandLine="/w" AddItemTemplatesGuid="{2606E7C9-5071-4B63-9A83-C66A32B1669F}" />
        <Host Name="Word" IconIndex="0">
          <HostItem Name="MyAddin" Code="Connect.vb" CanonicalName="AddIn" CanActivate="false" IconIndex="1" Blueprint="Connect.Designer.xml" GeneratedCode="Connect.Designer.vb" />
        </Host>
        <ProjectClient>
          <!-- BEGIN COMMENTED OUT SECTION -->
          <!-- <VSTO_CompatibleProducts ErrorProduct="This project requires Microsoft Office Word 2007, but this application is not installed." ErrorPIA="This project references the primary interop assembly for Microsoft Office Word 2007, but this primary interop assembly is not installed.">
            <Product Code="{XX12XXXX-XXXX-XXXX-X000-X000000FF1CE}" Feature="WORDFiles" PIAFeature="WORD_PIA" />
          </VSTO_CompatibleProducts>
          END OF COMMENTING -->
        </ProjectClient>
      </FlavorProperties>
    </VisualStudio>
  </ProjectExtensions>

Happy VSTOing!

Lightning Strikes

0
Filed under Rants

And let me tell you, in this day and age, lightning can just plain suck.

Garage Door opener, AC units, all my computers, UPS’s, TIVO, home audio, phone systems, NAS drives, cable box. You name it, it got smoked.

I’ve spent the last three weeks scrambling to get new machines setup, get backups restored (fortunately, I had recent ones), get repair techs out for the big stuff, and take care of the smaller stuff myself.

And I had a whole house surge suppressor, and well as UPS units on all my machines and some of my audio gear. Smoked them all as well.

So, any lessons learned? Oh yeah.

  1. Make SURE you know what’s covered by your UPS “connected equipment guarantee”. Keep all that paperwork filed somewhere for quick retrieval.
  2. Keep good records of purchases of anything you plug in. I keep mine in Quicken. Then keep backups of your Quicken data and the program disks so you can install to another machine and retrieve the data.
  3. You’ll typically have about 10 days to file a claim. So keeping recent backups of that data will help immensely with quickly pulling together all your records of what you had, when you bought it, and how much you paid.
  4. Check with your homeowner’s insurance. You likely have a 1% or 2% deductable. If your house is 250,000$, that’s a sizable chunk of change you’ll be out. And keep in mind, the insurance companies will depreciate the value of your equipment by how long you’ve owned it, so it might be even tougher to get up to that 1 or 2%.
  5. UPS’s can protect equipment but they won’t always work. Have backups. Make sure they’re restorable.
  6. You can almost be guaranteed that it’ll cost you more to replace all the equipment that you lost than it did to buy it in the first place. Why? Because if it’s computer stuff, you’re not going to go out and buy an exact replacement, you’ll buy something more modern, more harddrive space, bigger monitor, faster CPU, more memory, etc. Prices have come down since you bought, after all.

With the backups I had, it took a while, but I’m back online, and with almost my complete previous setup. Still lots of little stuff to take care of, but it’s getting there.

The good news is, we weren’t home, and there was no damage to the house itself, short of a few blown circuit breakers, and a blown GFCI.

In other words, lucky!

Word and the IsObjectValid Function

0
Filed under Office

One thing that can be maddening about programming against the Word Object Model is that objects have a habit of “disappearing” on you.

Say you retrieve a range, retrieve the fields in that range, then delete the range.

You still have references to those fields, but they no longer actually exist. Attempting to access any of the properties or methods on a field in this condition will cause Word to throw an exception with the message “That object has been deleted”.

Most code I’ve seen tends to handle these kinds of situations in one of two ways…

  1. Attempt to write the code such that if you’ve caused an object to become “deleted” that you simply don’t access it after that point. Sometimes this is easier said than done.
  2. Just wrap access to the object in a Try Catch, or On Error Resume Next. Test for any error condition and react accordingly. However, this has that nasty “the normal flow of code is through an exception” code smell. Not pretty.

Fortunately, there is third way.

The Word APPLICATION object has a function tucked away on it, called, appropriately enough, “IsObjectValid”.

Pass it a Word object model object and it’ll pass back true if the object is valid, or false if it’s been deleted.

Dim Rng = WordApp.Content
Dim Fld = Rng.Fields(1)
Rng.Delete
If WordApp.IsObjectValid(Fld) Then
   Debug.Print Fld.Code.Range.Text
Else
   'the FLD object is no longer valid
End If

Yes, it’s been around for a good long while so this may not be news to everyone, but it’s a handy trick to have in your toolbox if you work with Word regularly.