Archive

Posts Tagged ‘Windows’

Serial Control in Windows 7 – Part Deux

July 12th, 2010 Bob Keeney 7 comments

The Serial communications saga continues…. Never say die when it comes to serial communications because, like so many things in programming, there are multiple areas where the problem might lie.

Here are the facts as I knew them this morning.  Given a hardware configuration (serial port to fiber optic converter to fiber optic converter to Serial to USB converter), I could reliably talk to my device in Mac OS X and Windows XP.  In Vista and Windows 7 it failed.  The serial port monitor software that I running in Windows was able to see the messages with 100% accuracy while the RB serial control was not.

Sounds like an RB bug, right?  I submitted it, with video proof, and had a reasonably happy weekend.  The client was not happy, understandably, and after consulting with REAL Software (who, by the way, responded to my email promptly this morning) agreed that it might be a bug and they would be happy to try to reproduce (and ultimately fix it) if we sent them the hardware and a sample program and some money to do it for the R4 release.  R4 will come out sometime this fall, by the way.

The client was not happy about the additional cost and the time delay as you can understandably imagine.  So I said I’d do some research and figure out if other people are having serial issues too before issuing a recommendation to send all the materials to RS.  I’m sure some of you are guessing where this is going.

It just so happens that the specific manufacturer of the Serial to USB Converter (Prolific) has some serious issues with their Windows 7 (and Vista) drivers.  After a few more specific web searches I found an alternative (perhaps older) driver that works fine if you do the following in Windows 7:  Right click on the properties of the installer, select Run as Administrator and select Vista SP2 under the compatibility popup.

Run the installer, restart Windows 7 and Voila!  We now have a fully functioning driver – that works – in Windows 7.

Hindsight, as they say, is always 20/20 and I *should* have thought about this last week.  I had “something in the middle” that I assumed worked.  I had evidence that it did work (the serial port monitor) but my assumption was false (obviously).

Debugging serial communications (and network communications for that matter) is a royal pain in the behind.  When something isn’t working, work the problem backwards.  When there’s hardware involved, verify that the hardware works or try to eliminate the hardware.  In my case, my Windows 7 doesn’t have a true serial port (it’s running on my Mac in VMWare).

So maybe you’ll learn something from my experience and pain.  Maybe you’ll keep yourself from having a bruised forehead (from banging your head up against a brick wall).

Happy coding!

Serial Control in Windows Vista/7 Doesn’t Work Properly

July 9th, 2010 Bob Keeney 2 comments

I’ve had one of those weeks where I thought I was going crazy (crazier?).  My cross-platform application that works fine on Mac OS X was behaving very strangely in Windows but only sometimes.  This particular application talks to a hardware via a serial port.  My standard test platform is Windows 7 with Windows XP as the secondary and both of these are run in VMWare on my Mac.  So a bunch of things might be at fault but after trying this out on an old Windows XP laptop I quickly narrowed the problem down.

The data packet the hardware device sends is very small – 4 characters to be exact.  What I was experiencing was that RB captured the first character on the first send – but not the whole packet.  Then it would complete the first message on the 2nd message and only get part of the 2nd message.  It would go something like this:

  1. A
  2. B | A
  3. C | A
  4. D | A

Where A is common to all messages so they should be AB, AC, AD and so on.

These messages in the real world are sporadic and with the exception of a regular hardware pass message it might be days or weeks in between messages so as you can imagine, this problem mucks up the logic quite a bit.

If you are not familiar with the Serial control, the DataAvailable event fires when there is data available (duh) and there you can check what’s in the serial buffer by using the LookAhead function.  LookAhead in this case showed just the first character.  The other property to check is  BytesAvailable which should tell you how much is still in the buffer.  It simply returned zero so I should have a complete message.  Definitely something screwy going on there.

Invoking Serial.Poll via timer did not produce any different results.  Neither did forcing a ReadAll.

One other thing that I discovered was the Serial Port Monitors are worth their weight in gold.  Using one, you can at least verify that the data got to the computer.  A free 14 day trial was good enough but if I do any other serial projects it will be worth it.

The good news is that I wasn’t crazy.  The client is okay with Windows XP for now.  The bad news is that it might take a release cycle (or more) to get it fixed. Oh well, battles for another day….

For those that care, the Feedback id is 12723.

RB 2010 R2.1 Has A Nasty Windows Bug

July 1st, 2010 Bob Keeney 25 comments

Be aware that RB 2010 R2.1 has a nasty Windows-only bug that might affect you.  It seems that the keyboard accessibility for pushbuttons (and possibly other controls) no longer works properly.

To duplicate, put two pushbuttons on a window.  Put a message box in the Action event saying which one has been pushed.

Test it with the mouse.  Works fine.  Now tab to each pushbutton and press the spacebar.  Works fine.

Now, tab to each one and press the Return or Enter key.  Nothing.  If you happen to have a default pushbutton the Enter/Return key will activate that button regardless of where the focus is.

Nasty bug that leads the average Windows user to curse your name in vain if they rely on the keyboard to navigate.  I spent hours trying to figure this one out because it manifests itself in the MessageDialog class too.

Yeah, I’m a little pissed.   I have to revert to RB 2010 R1 where it does not manifest itself.  The hard deadline for the project I’m working on is today.  Gives me a black eye for a problem outside of my control.

For those that care, Feedback ID 12626

REALbasic IDE: Mac vs. Windows

January 25th, 2010 Bob Keeney 9 comments

Normally I run REALbasic on Mac OS X and remote debug in Windows.  This works 99.9% of the time but late last week I ran into a situation where I wanted the IDE on the Windows side as well.  So I installed RB and downloaded the plugins that I needed.  Then I started to use RB.

Using RB for Windows was…different.  I’m not sure that I can quantify it other than that it seemed less polished.  It just doesn’t feel like a normal Windows app and it certainly was not as smooth as the Mac OS X version.

The reason I was in Windows to begin with was of tracking down a printing bug that was affecting my product.  Turned out it was the Application.UseGDIPlus property that had been set to true.  The end result was that my reports were ‘blown up’ about 10 times bigger than they should have been.  This has been documented and is <feedback://showreport?report_id=10399>.  Turning off the property fixed the problem.  Some fix, eh?

I don’t think that Windows gets as much attention as the Mac OS X.  Why do I believe this?  The ARBP surveys consistently show Mac users being about 80% of the membership.  Likewise, traffic to this website is roughly 80% Macintosh.  What this means is that beta testers are predominantly Mac based.  I believe that most of the developers at RS are Mac users as well.

Currently, RS is in the transition to get Cocoa out.  It won’t be happening for 2010 R1…so it’s obviously a much tougher nut to crack than they originally thought.  Honestly, I’m not surprised.  Going from Carbon to Cocoa is like creating an entire new platform.  Eighteen months to two years isn’t out of the question for such a big undertaking.

I’m hoping that when Cocoa is out and working great (you think it won’t have some bugs in the first release?) that RS pays a lot of attention to Windows.  They’ve said in the past (sorry no reference for this) that a vast majority of new licenses are Windows users.  But yet, based on observation, the professionals and beta testers are mainly Mac users.  Does that not say something?  Would better Windows support translate into more Professional and Studio licenses?  I don’t know, but I suspect so.

Perhaps it’s time to kill support for Windows 2000.  I’d even suggest killing off XP but I know a lot of places in the world are still actively using it so that’s probably a non-starter.  I believe Cocoa support will effectively kill support for anything less than Mac OS X 10.4 so why not for Windows too?

I suggest that everyone that has a Studio license do a bulk of their work in Windows for a couple of weeks.  More Windows-specific bug reports will (hopefully) get some of the more obvious (and painful) bugs fixed.

What are your feelings about this?  Am I right, wrong, or somewhere in-between?

REALbasic Training Videos At BKeeney Software

January 12th, 2010 Bob Keeney Comments off

Making a screencast video presentation is more difficult that you image.  First you figure out the script, then you do the recording (perhaps more than once), then do any editing (cut the coughs and um’s, speed up long typing sequences, etc), add any callouts or special effects, then convert to the appropriate video format, upload the video and finally create an accompanying article to go along with it.

Whew!  That’s a lot of work.  I’ve done this for over nine hours worth of material so far!

We, BKeeney Software, are now offering streaming videos for REALbasic training with over an hours worth of free video (you do have to sign up for an account though).  To say that this has been a labor of love is understating the scope of the project.  With nine hours of video we’ve barely scratched the surface of all that REALbasic has to offer.  We have many, many things still left on the plate. I look at this as a never ending stream of videos as REALbasic is always evolving (on a 90 day basis!) so the work will never be done.

With nine hours available now, what’s it mean for a month or year from now?  I don’t honestly know, but as I’m writing this I’m encoding and updating another twenty-six minutes of video.

Since this is REALbasic I spend a lot of time working in one environment, Mac OS X, and doing debug runs in Windows 7 and Linux (Ubunutu) and show you the big, little and sometimes subtle differences between the platforms.  You’re seeing how I approach a project from the ‘what I’m going to do’ to implementing it and doing final testing.  And yes, you get to see me make some mistakes (hey, don’t we all?) and through the magic of post editing I’ll point those out when I do them so you’re not confused and then we show the correction process.

This is not a typical video training program.  We have five hours of video just on the basic controls available for REALbasic.  Not only do we describe what it does and some of the things to be aware of, we use the control in a project and examine what it does in Mac OS X, Windows, and Linux when there are differences.

My goal is to make you a better REALbasic programmer.  I name EVERYTHING from RB objects to my variables in source code so that they mean something.  At a glance you should be able to tell what your source code is doing because you’re not just writing code for right now, but you’re writing code for six months and six years from now.

Sign up for an account and automatically get a free Guest Pass.  Poke around and take a look at the free videos.  We’d love it if you’d sign up for a subscription.  With our introductory pricing, a three month subscription costs $45.  A year subscription is $150 which is a 20% savings.

What’s great about the video training?  You can help direct what videos are done next.  REALbasic has thousands of classes – some with poor documentation and examples.  We can create the video training that helps you out sooner rather than later.

That’s it for now.  Happy coding!

Windows 7 and the REALbasic HTMLviewer

August 17th, 2009 Bob Keeney 3 comments

I don’t venture into Windows-land very often but I ran across a couple of articles today that gave me cause for concern.

http://www.microsoft.com/presspass/press/2009/jul09/07-24statement.mspx is talking about how European users might get to choose which browser is used by their machine.

The second is http://www.aeroxp.org/2009/03/ie8-functionally-removable/ is about how Internet Explorer is functionally removable from Windows 7.  The article states that the procedure only removes the Internet Explorer executable and not all of the supporting libraries so it shouldn’t be much of a concern to RB developers.  Or is it?

During the ARBP chat last week, REAL Software president and CEO, Geoff Perlman stated that he was unaware of any Windows 7 incompatibilities.  No one asked specifically about what happens if the user uninstalls Internet Explorer in Windows 7 or a European users chooses FireFox, Safari, Chrome or Opera as their web browser rather than Internet Explorer.

Will the HTMLviewer still work?  I think it will because it’s dependent upon the supporting libraries but it’s a question that I’d like reassurance on from RS.  But perhaps the real question is whether the HTMLviewer.IsAvailable is an adequate check and it jumps into the libraries or if it’s simply a check on what version of Windows you’re running?  After all, if you’re using Windows XP or Vista you HAVE TO HAVE Internet Explorer.  But it seems like Windows 7 might be changing that rule.

I’ve been particular critical of the HTMLviewer control over the past several years.  Yes, RS has worked some of the bugs out but it’s still not as stable as I’d like to see it.  My biggest beef is that it’s not using the same supporting libraries on Windows, Linux and Mac OS X.  On Mac OS X it uses WebKit.  On Windows it uses Internet Explorer and on Linux it uses GTK.  This leads to platform incompatibilities, instabilities and downright bugs between the platforms.

If you didn’t read the release notes for RB 2009 R3 you’ll find that RS isn’t shipping REALbasic with the Language Reference for Linux because HTMLviewer has too many issues so Linux users have to rely upon a PDF version.  Ouch.

REALbasic’s strength is cross-platform so why not use a cross-platform web browser as the basis for HTMLviewer?  Use Gecko (Firefox) or Webkit (Safari and Google’s Chrome)!  We might need it for Windows 7 which is being released in October?

Thoughts?

RB For Windows

May 27th, 2009 Bob Keeney Comments off

I spend most of my time using REALbasic in Mac OS X.  About the only thing I ever need to do in Windows is test applications and using the Remote Debugger works fine for that. Unfortunately, one of my projects is requiring a bit more coding work than is reasonable using the Remote Debugger.

So this morning I started up VMWare and installed REAL Studio (since I figured, hey, I ponied up the money for it I might as well use it) and either copied or redownloaded all of my plugins.  And then started RB for Windows.

I must say that it’s…um…not nearly as pleasant as working in Mac OS X.  The UI doesn’t refresh properly, it responds somewhat sluggishly and in general it just seems a bit ‘spastic’.  After I bumped my VMWare memory up to over 2 GB it was better but it still wasn’t hard to get the UI to erase itself and stay erased for 10 to 15 seconds.

My app uses a number of threads to increase performance in Mac OS X and it sure seems like the threads are slowing DOWN my performance in Windows.  Is this a common problem?  I’m really starting to wonder if I need to spend more time running RB in Windows to really understand what the Windows ‘experience’ is.  I’m also wondering if there’s a significant difference between Windows XP and Vista (and Windows 7 by extension).

Is it time for RS to really get serious about Windows after they get done with Cocoa?  Do you have any tricks for increasing performance of REALbasic for Windows?  Are you seeing the same sort of issues?

Cocotron

October 28th, 2008 Bob Keeney Comments off

More info on Cocotron can be found at http://www.cocotron.org/.  Their stated goal is:

The purpose of the project is to provide an easy to use cross-platform solution for Objective-C development.


There’s a blog post at Mac Daddy World at http://macdaddyworld.com/2008/10/27/adventures-in-cocotron/

Now I can say with some certainty that xCode and Objective C isn’t as easy to learn and use as REALbasic but a programming language is a programming language and we can all learn “one more” language and IDE.  Certainly one of the truths about REALbasic is that all of it’s controls are a compromise and not as feature rich as their .NET and Cocoa brethren.  Cocoatron has the potential of changing some minds of people who might be looking at REALbasic and go with Cocoa if controls on both platforms are nearly identical.


It seems that Cocotron isn’t an officially supported Apple product but that might not matter in the long run if enough developers start using it.  Stranger things have happened in other platforms where something becomes a de-facto standard.  It wouldn’t surprise me either that Apple has a skunkworks project that does this as well so it’s possible that at any point Apple could go, “Because of demand, here’s the official Cocoa for Windows frameworks.”


One major issue I see with Cocotron is that you can only do code development on the Mac.  That is certainly one of RB’s strengths where you can run on Windows, Linux or Macintosh OS X and compile and debug for the other platforms (Pro editions only).


One thing that is similar to RB is that it looks like you can debug your Windows app while running in the xCode IDE.  I wonder how fast or slow that is?  I might just fire up xCode this weekend.

Your thoughts?

Windows Activation Sucks (Like This is New?)

May 12th, 2008 Bob Keeney Comments off

My old 7 year old Dell is now (or will be after getting activated) relegated as the kids computer.  This means I don’t care what they do to it as long as it still boots up and can run the occasional test app.  It had a bunch of development software on it and old files that they kids don’t need and that they probably shouldn’t see anyway (no, not porn – like old contracts and stuff like that).

So I wiped the drive.  I reinstalled Windows XP SP1.  Of course I couldn’t find the original Dell drivers CD so I had no network connectivity.  So I had to download a network driver from the Dell website using my trusty iMac (which now runs XP, Vista, and Ubuntu) and burned it to a CD so I could install it on the Dell.  Great.  Finally got the network up and running via ethernet cable – forget about the Wireless network for now.

So I figured I’d just bite the bullet and activate Windows sooner rather than later because I know it’s going to choke on some new update that requires Windows to be a certified genuine live advantage BS (or whatever they’re calling it these days).  I knew this was going to be painful as I just activated Windows on not just one, two but three copies of XP on two separate iMac’s running VMWare and one running Parallels.  Each time it failed validation and required a phone call.

So this brings you to the validation window and an 800 number that forces you to type in what seems to be a gazillion set of 6 digitis.  Since I’ve been through this before I went to the bathroom got a drink and got into my best yoga position to achieve a zen moment even though the pleasant recording said it would only take ‘about’ six minutes.  After speaking into the phone like a friggin’ idiot with all those numbers, I’m oh so pleasantly told that she couldn’t help me.  No shit.  I could have told her that before I started but that wasn’t an option.  So now comes the really fun part.

I get transferred to someone half way around the world where I have to give them the numbers AGAIN!  Come on folks, this is computer company that is supposed to help companies do a better job with their data.  Couldn’t the call router send an id to the db record that I’m sure it just recorded?  Obviously not.  Instead I have to talk to someone half way across the world with a horrible phone connection and after the first three sets of numbers their phone system hangs up.  Good thing the kid was asleep because he would have learned a few things.

So I go through the whole process again even though my zen moment is gone.  The computerized activation system, the transfer to a human being and I this time somewhere on the planet a phone rings twice and the system hangs up again.  So Microsoft has now wasted about 6 hours of my time between reformatting, not having all the drivers needed and trying to activate Windows.  And I’m not.  Done.  Yet.

It would have been far simpler and cheaper to just go buy a new computer and throw the old one away.  And people wonder why I’m pro-Apple.

If I wasn’t  a cross-platform software developer I would be a Microsoft free household.  At least with REALbasic I can develop on the Mac and only use Windows when I have to.  VMWare and Parallels makes this incredibly easy to do and more or less pain free.

Do I feel better now?  Only partially because I know that I’ll have to go through this whole process again tomorrow sometime.

Categories: Microsoft, Opinion Tags: ,