Thursday, June 16, 2005
Splitting Properties Between Header And Implementation Files In C++/CLI

I've been working on a managed C++ application that uses the C++/CLI (Whidbey/2005/etc) syntax. While many of the new syntax changes have been really useful, I found that there is practically no documentation on how to split properties between header (.h) and implementation (.cpp) files. I figured I'd post this for any folks who come across the same issue.

Let's say you have this .h file:

ref class MyClass
{
public:
    property int MyProperty;
};

By default, the C++ compiler will automatically back MyProperty with a hidden int (or whatever you're using). This means that you don't need to give it any implementation code in your .cpp. In fact, if you try to, it'll throw an error that you've already defined its get/set since this is implicitly done. If you want to define your own implementation for the get/set, you'll need to change it to look like this:

ref class MyClass
{
public:
    property int MyProperty
    {
        int get();
        void set(int value);
    }
};

At the same time, you're now on the hook for fulfilling these methods yourself, so your .cpp file will need to look something like this:

int MyClass::MyProperty::get()
{
    // Do what you need to return the property value
}

void MyClass::MyProperty::set(int value)
{
    // Do what you need to set the property value
}

Note that you don't need to specify any special keywords or format as get_ or set_ and you can use any valid name for the set() parameter ("value" isn't required). If you want to make your property read-only, then you need to explicitly provide a get() but not a set(). If you want to make your property write-only, put the keyboard down and take three steps backwards :-)


6/16/2005 9:38:49 AM (Pacific Standard Time, UTC-08:00)  #    Comments [6]  

 Sunday, June 12, 2005
At Least HR People Should Be Good At Updating Their Own Resumes

I recently came across http://blogs.msdn.com/jobsblog/archive/2005/06/01/423909.aspx, a blog posting in which a Microsoft human resources employee expresses their frustration over having to work with arrogant hiring managers. This posting has generated a ton of feedback, most of which has been surprisingly positive. Details of the hiring process is best described at http://saunderslog.com/?page_id=312.

I understand both sides of the argument. Defending HR, I know that it can be very hard to attract candidates that reach the bar set by MS managers. At the same time, I’ve had more bad experiences with people at MS HR than good ones so I can empathize with the hiring managers, probably due to the fact that good HR people handle your issue in one shot whereas bad ones require a lot of pushing and many iterations. Regardless, I don’t have a useful opinion on which side is more correct or how to fix the outstanding issues.

I can say—and I think a silent majority would agree—that the way this HR person handled this situation was pretty awful. Rather than driving change from within the company, the decision was made to do as much damage to the company’s image and the individual’s reputation as possible (I was tempted to use the term “suicide bomb” here). Having seen a few people do this sort of thing before, it doesn’t surprise me. What does surprise me, however, is the number of people hailing this person as a hero.

How could this action be considered courageous? How could it be heroic? To me, courageous and/or heroic would be driving change in Microsoft internal policy by directly confronting the issues and people involved. Airing dirty laundry in order to embarrass the change by someone with more courage (or fear of execs destroying them over this) is a lot harder and more impressive. And no, I don’t believe this person made a reasonable effort to fix this through rational means or else it would have been mentioned in the posting.

In particular, I think that the tone and language of the posting is almost laughable. While the responsibilities are quite different, I expect HR reps to have the same composure and people skills as product managers (possibly more, considering their actual business function). This section is probably where the most damage occurs:

“Quite honestly (maybe here is where my tirade kicks in), I’m sick and tired of the Hiring Managers around here not trusting their recruiters.  Hi there – news flash.  Guess what?  I probably have a higher IQ than you (yes, I just went there), and I “get” it.  Trust me.  They pay me the big bucks to be an expert on hiring for the company.  You do your job; I’ll do mine.  Plus, you don’t see me getting in your business every time some Microsoft program crashes on me, do you?”

To be very clear, I wouldn’t fire someone for having an opinion like this or expressing it--although it would piss me off if they had this problem and went public instead of coming to me. However, there is a good chance I would fire them for the lack of respect they clearly have for their coworkers. It’s hard to let one overly arrogant person get away with publicly embarrassing every senior manager in the company.

If you’re Microsoft, however, you can’t really do much. If you fire this person, or any of the other people who do the same kind of blogging, you’ll be unable to avoid the stigma of censorship. Heck, look at how much flak the company is taking over MSN Spaces in China. Just imagine the “Microsoft Fires Heroic Blogger In Act Of Unmitigated Censorship” headlines.

So how should Microsoft handle this situation? It’s practically impossible to fire people there, unless they break the law or commit a significant HR violation that really upsets someone. That leaves very few options, but I’d love to hear if anyone has anything clever (and legal). Assume you've already had their manager send a supporting email to keep them from doing anything rash before you've decided their fate, what would you do?


6/12/2005 10:45:58 PM (Pacific Standard Time, UTC-08:00)  #    Comments [0]  

"Build Comment Web Pages" Is Broken With XPSP2
Check out http://blogs.msdn.com/vseditor/archive/2004/07/16/185788.aspx for a workaround.
6/12/2005 9:57:47 PM (Pacific Standard Time, UTC-08:00)  #    Comments [0]  

 Friday, June 10, 2005
Be Careful With Those Frequent Flyer Numbers!

When I rented a car from National via Expedia last week, I saw a spot to enter my Frequent Flyer number, so I did--it's kind of a reflex these days. When I arrived to pick up my car today, I learned that there is a $1.50/day "Frequent Flyer Number Charge" required for me to "earn" miles (Alaska Airlines in this case). The clerk informed me that I could prevent this charge in the future by not entering my number when asked. I might have been insulted if I wasn't so annoyed :-)


6/10/2005 7:20:32 PM (Pacific Standard Time, UTC-08:00)  #    Comments [0]  

 Monday, June 06, 2005
What's The Deal With igfxext.exe Anyway?

Every time I try to watch a .dvr-ms (Media Center records in this format) or DVD the igfxext.exe process floors my CPU and nothing happens. Once I kill it in Task Manager everything resumes as suspected with no apparent downside. If you're having the same problem, try this workaround out.


6/6/2005 1:09:32 AM (Pacific Standard Time, UTC-08:00)  #    Comments [0]  

 Thursday, June 02, 2005
Upgrading To The Redmond Public Services Universal Subscription

My wife and I recently went to China for a week. While we were gone, the burglar alarm was triggered in our home. We have a security monitoring company, who called the home, then my wife, then my cell. Since we were in the air at the time, we didn't answer. Their next escalation point was the Redmond Police, who informed them that they refused to check out the home since we hadn't paid the annual $10 "home with a burglar alarm" fee. I was a little annoyed at this--partly because of the fee (which we weren't aware of at all), partly because the alarm company didn't disclose this info nugget at the time of our contract signing. The Redmond Police were nice enough to send us the form in the mail after rejecting our monitoring company's plea for help. Unfortunately, they didn't mail it to April, 2005, so there's not much we can do besides pay it and hope there is no more red tape for next time.

Most of the people I've told about this have said things like "you have to pay the police extra money to do their job!?!" The reality is that we didn't know about it, but that doesn't absolve us. But what really annoys me is that they could have served and protected in a much more effective way if they had checked out the house this time and sent us the form afterwards. If we didn't pay the fee, then they could refuse next time. I wish there was a way to ensure we were covered in all the ways we take for granted (hence the need for a RPS Universal subscription). Now we need to contact the fire department to make sure they would check out a fire alarm, etc. 

We happened to be lucky and weren't missing anything--if someone had tried to break in, they were probably scared off by the alarm. If you're in a similar situation, you might want to make sure you're covered.


6/2/2005 9:18:47 PM (Pacific Standard Time, UTC-08:00)  #    Comments [3]  

 Friday, May 20, 2005
HOWTO: Getting Fired From Your Spokesperson Job

As many folks are probably aware, Netscape launched a "super secure" product that turned out to have a significant number of security holes. That sort of thing happens from time to time, so I'm not going to harp on it. However, one thing that really stuck out was a quote found across several articles (for example, http://news.zdnet.com/2100-1009_22-5715360.html):

"We had been misinformed by an external security vendor that the Firefox security issues did not affect us," Netscape spokesman Andrew Weinstein said Friday. "Within hours of discovering that the vendor was not accurate, we had addressed those issues and posted an updated version of the browser."

When I was at Microsoft, one of my responsibilities was briefing the technical management of major customers on Longhorn with respect to application development. Given that these organizations included Fortune 500, government contractors, the US military, etc, these briefings usually included a significant security discussion. It got so common that I would begin each briefing with 3 slides on Windows XP Service Pack 2 (in development at the time) just to address the things they most cared about today. If I *ever*, at *any* time, implied that Microsoft wasn't responsible for the security of its products--whether in reference to past or future versions--it would have caused tremendous damage to our credibility with that customer.

The way I translate the above (putting the de-PR hat on) is:

"We built this product and wanted it to be secure. Since we don't have the ability and/or inclination to verify its security, we paid this other company to figure it out for us. They told us it was okay, so we slapped an installer around it and posted it to the Web. We didn't verify their results ourselves, so don't blame us!"

Like I said, I understand that things like this happen, but I just think that passing the buck is unacceptable for a company like AOL. Then again, the spokesperson may have been misquoted, which does happen. For their sake I hope it did, in which case they better get their PR org inline for letting this post as it is. Even when you say stupid things to the press (which I have done too many times) good PR people (which I always had the best of) can get your statements clarified to avoid embarrassments like this.


5/20/2005 12:46:57 PM (Pacific Standard Time, UTC-08:00)  #    Comments [1]  

Welcome Chris Mason To The Blogosphere
Chris Mason, one of the devs here at SharpLogic, has begun blogging at http://www.sharplogic.com/blogs/cmason. Chris is doing the early working on one of our commercial endeavors, which means he's pretty much not allowed to talk about the details of his day job. This will definitely change soon (I don't know how soon) but needs to be kept this way for the time being due to IP and disclosure reasons. In the meantime, enjoy his wit and insight from the perspective of an experienced QA engineer turned dev.
5/20/2005 1:58:37 AM (Pacific Standard Time, UTC-08:00)  #    Comments [0]  

 Tuesday, May 17, 2005
Coding4Fun & VS Express Hit Fortune Magazine

http://www.fortune.com/fortune/technology/articles/0,15114,1061773-2,00.html

Congrats to Brian Keller for landing the terms "my mom", "watch a video", and "RFID reader" in the same quote :-)


5/17/2005 2:49:35 PM (Pacific Standard Time, UTC-08:00)  #    Comments [0]  

 Monday, May 16, 2005
The Internet Sure Has Changed Things

I remember being back in the schoolyard saying things like:

"I looked up 'ugly' in the dictionary and your picture was there".

Now I find myself saying things like:

"I looked up 'bastardized' at dictionary.com and there was a Google Ad for 'The Dukes Of Hazzard' movie".

Life sure was simpler back then.


5/16/2005 11:04:01 AM (Pacific Standard Time, UTC-08:00)  #    Comments [0]