Tonight, for the first time, I acutally wrote VB6 code on my Vista box. Overall, not a bad experience. Of course, it couldn't be flawless, because there's no way that you can say VB, me, Vista, and Microsoft in the same sentence and even dream about saying flawless. Here was my one slightly annoying (could have been extremely annoying had it not been for some really helpful web pages) issue. My code had SendKeys calls all over the place. Yeah, yeah, yeah, I know - real developers don't use SendKeys - they use elegant API calls or DOM stuff. Yeah, I hear you - but real developers probably aren't trying to write completely goofy applications that use the Microsoft Image Viewer either....So, kill me if you must, but that doesn't change the fact that I was using them...and everytime the code hit a reference to SendKeys I got a runtime (70 for you number geeks) error...Permission Denied. Yuck! After some looking on the web, I found that it was the User Account Control (fondly called UAC) in Vista that was hosing me. You know this is the thing they were talking about in the Mac commercial where the cute guy from Ed plays the Mac and some geek plays the PC and there's a third guy there asking, "Are you sure?" everytime geeky PC guys says something and cute Mac guy just rolls his eyes...
So, to fix it, I turned off the UAC. Here's how to do that.
1. Go to Control Panel.
2. Open User Accounts.
3. Click Turn User Account Control On or Off (no, it doesn't tell you what yours is set to - you have to go the next screen to find out - kinda annoying if you ask me!).
4.Take the check out of the User User Account Control (UAC) to help protect your computer.
5. Click OK
Voila, SendKeys works. Of course, now cute Mac guy has nothing to roll his eyes about....
Sunday, September 16, 2007
Subscribe to:
Posts (Atom)