Tuesday, March 21, 2006

I didn't forget. . .

I'm working on the next installment of the career journey, but today was just one very busy day!

I wonder, at times like this, why Microsoft, with all of their money, research, time and expense, has made automating their “Office” suite such a nightmare.

Oh they have a completely documented object model, if, and only if, you want to automate it using Visual Basic, or VB.Net. Pick any other language, even another Microsoft language and you’ll find yourself spending more time deciphering some cryptic implementation of the model and immersing yourself in minute details you’d think would be handled in a more straightforward manner.

Parameters are the bane of my day, at least right now. You see, in the Office Object model, parameters are passed as ‘Named’ parameters, and the order that they’re placed, due to the fact that they’re named, is irrelevant. However, when you’re using, say Microsoft Visual FoxPro, which (at least in version 8) does NOT allow for passing Named parameters to the ‘object’, you not only have to get the order right, you also need to extract the ‘constants’ from the model so you can decipher the correct vales to pass.

Sometimes, I wonder if we’re really moving forward, or sideways… or really backwards.

On the other hand, when this little app I’m building fires… it’s going to be off the hook cool to see it build in about 60 seconds what was taking a person an entire day to do!!

That’s why I do it… for those ‘crazy cool’ moments when every little thing is finally in place… I flip the switch… and the magic happens!!

More on the journey in the next day or so!!

Technorati Tags: - - -
-IceRocket Tags: - - -

7 comments:

Karyn Lyndon said...

Re: Blogmad

Like the proverbial tree falling in the forest...Is it a stat count if no one comments?

Bill said...

Karyn - You know, the truth is, I find myself being happier with comment counts than with the hit counter.

I love the feedback and dialog that goes on here. I think the posts I'm proudest of are those where the comment/dialog that was inspired eclipses the actual post!

Spirit Of Owl said...

Microsoft is too big... The left hand might know what the right hand is doing, except the left and right hands in question are among thousands of hands that since the Windows 95/Office days have clearly not known where each other are. And that's only the user software, let alone the developer software arms... It's a damned mess!!!

Greg said...

It certainly does appear confusing...back in the old days(ADO 2.6 I think) we used to have Namedparameters = False (I think I recall,...ouch...ouch) seems they would still have switches like that for backwards compatibility for ol' timers and the like...
On the other hand, encapsulating and naming objects like parameters was what we were after, so I guess it could be recieving half of what you wish for...
at any rate I sure hope your project flies....bet it does!

Bill said...

Spirit - Yep.. that's the skinny... a lot of chefs in this particular stew!!

Greg - In VFP? Not that I recall (of course I have forgotten things in the past!!), in VB, VBA and VB.Net for certain.

I'll post an example of what I'm talking about later tonight... it's just very annoying, more than confusing.

(Named Parameters do work in pass through SQL, but not via Object Automation, which is where I think your confusing the ADO model, with the OA model)

Rick Schummer said...

I understand your pain Bill. One way to eliminate some of it is to use the Object Browser included in VFP. This tool provides you the list of parameters and the order they go in, and will help you build the #DEFINEs for the constants. For a start you can check out my blog entry on the subject: http://rickschummer.com/blog/2006/03/foxpro-tips-object-browser.html

Bill said...

Rick - I actually use so many versions (for various clients) of the Office Object model, I've written a little utility to extract them into a ".H" file depending on the version I need.

While I like the VFP object browser, I prefer to build the process in VB or via a macro and then use the VB help to determine the order as, for whatever reason, it's clearer to me than the VFP OB presentation.

I'll check out your blog later today, it's always good to meet another person working their way through this.