Stupid, Stupid VB

Once again a couple of days ago I was turned into a Visual Basic whore. This time it was “real” VB, not VBScript. I thought it’d be better, a more Bill-like religious experience.

Boy was I wrong.

Short story, man, it sucks. I’m not talking about the language itself, but the interface you are forced to deal with to do any work with it. In my case this horror was Visual Basic 6.x I’m going to make a guess that you can’t just open up the source code in a real editor, but I haven’t confirmed that, nor do I really care to.

Things I want to bitch about.

  • If the program is running, you can’t edit the source code.
  • The help window’s last option when you right click on it in the task bar is not close, like every other window, but an ‘About HTML Help…’ option
  • The home key will take you to to the end of the line if you are not there already, and then you have to hit it again to go to the start of the line. Isn’t that a bit counter-intuitive?
  • When the program you write has a modal dialoge box popped up (say, for debug purposes), you can’t switch back to the IDE and stop the task! So if you’re doing debugging where a message box is up on every iteration of say, a loop, you have to be really fast to hit the “OK” button and then hit “stop” in the IDE.
  • If you’re not fast enough, you can always go to the task manager and kill the application (not the IDE). Oh wait, the two are tightly tied together, so now you killed your development environment as well!
  • The help system is nice, but if I say I only want to search in the Visual Basic Documentation only (via the “Active Subset” drop down), I mean it! Don’t give me other topics, only what I ask for. Another fine example of Microsoft giving the user what they think the user wants, not what they asked for.
  • If you’re going to ignore my topic to search in the help, at least save the sort field of the results so I don’t have to resort after every search.
  • And why can’t I open more than one help window at once? What if I want to look up two things at the same time, and compare them or switch back and forth?
  • Ok, looking back at the above bitch about the help search not using my filter, it is, kinda. It’s restricting from some documentation, like the really extranious stuff, but “Visual Basic Documentation” also searches IE, MS ADO, Active Server pages, and a bunch of other stuff that seems loosely tied to VB. Why can’t I search just the Visual Basic Reference?
  • Who thought up the “rank” system for the search by the way? I search for “MsgBox Function” and the page titled “MsgBox Function” gets a rank of 17, while “Designing an error handler” gets 1. “Change Event” gets 111 (it’s the 111th result), and I’m not sure which way the scale of “rank” goes. They need to take a look at google I think.
  • Why doesn’t my scroll mouse scroll? It does in every other app I’m using right now.

It could be worse though, years ago I was forced to do some coding in a program called Reflections, which had it’s own bastardized form of Basic called Reflections Basic, which stored all the code in binary, so you had to use their editor, and their editor wouldn’t let you open more than one file at a time! You had to start another instance of the development environment just to see another file.

34 Comments on “Stupid, Stupid VB”

  1. Dude, I’m with you on all of that. I found just using Google or searching through one of the many online books 🙂 about VB to be most useful. has never ever made sense. Google does a better job of indexing MSDN then MS’s engine does!
    Lession #1 I learned (the hard way) is save often. And just to be sure, save inbetween the saves as well.
    The only nice thing about the debugger is that you can change the code while it’s running… so set a breakpoint in a loop, hit pause, change something further down the loop, then hit continue to view it. Oh, and being able to hold your cursor over the variables in the code to see the current value.
    You can open the *.frm files in Vim, but it’s pretty pointless. You get all the layout for the forms on the top of the file, but then you miss out on the code insight features, the (admittaly annoying) syntax checking, etc.

  2. Bitching about VB

    Arcterex (via Scott) bitches about Stupid, Stupid VB. I’m quite fond of VB (but thats not to say its not without its problems), but I have been using it for years, and some of his complaints are just plain wrong. So lets go through them one by one… *…

    • If the program is running, you CAN edit the source code. Just click the Break button, perform the edit, and then Run again.
    • When a modal dialog is open, try pressing Ctrl+Break, a shortcut for Break that is recognized both by the IDE and by your running app.
    • They’re not tightly tied – the VB IDE IS your app – they run in the same address space. This is necessary because the debugging APIs require multi-threaded debuggers, and VB’s IDE is only single-threaded.
    • You CAN open up more than one copy of the help system, via the shortcut on the Start Menu. VB itself, however, will remain “bound” to the one it opened, and will use that for launching help shortcuts.
    • The mouse wheel…yeah, that’s kind of unforgiveable…but there are programs that will retrofit apps like VB to work with the wheel.
  3. The mouse wheel is most annoying for me because it actually works at the office but does not at home…a royal pain to get used to one method and have to switch to another later…

  4. By the way, Reflection finally ditched Reflection Basic and started using VBA . . . badly, I might add. Annoying among many other problems is that the Left() function doesn’t exist in their version.

  5. The mouse wheel works if you have IntelliPoint drivers installed, rather than the built-in Windows drivers.
    You can edit what those help filters mean, somewhere… I’ve seen the dialog for it, but never bothered since I always just use instead of local help…
    I don’t mind the VB6 IDE nearly as much as I mind the language itself…! 🙂

  6. I got this page by searching for mouse scrolling issues. One day the mouse works then today it doesn’t!!?? I opened the IntelliPoint properties and clicked the “Restore Defaults” button on the lower left-hand side of the default tab. All my settings remained and I got the scrolling back.

  7. “The mouse wheel works if you have IntelliPoint drivers installed, rather than the built-in Windows drivers.”
    I wish. I’ve got the latest IntelliPoint drivers installed and an actual Microsoft product (Wheelmouse) and it’s still not working.

  8. Regarding mouse wheel:
    Everywhere I went said “It works if you have the drivers installed.” Well, I had a Microsoft Wheelmouse, and the most current drivers, and it still wasn’t working.
    This fixed it:
    Intellipoint Settings -> Wheel Tab -> Wheel Troubleshooter Section -> Advanced Button
    There are two options. Select the one that only disables the mouse for the programs listed (rather than all programs).

  9. Regarding mouse wheel:
    I’ve only gotten the “drivers” solution to work on some machines. I’m using Win 2003 now, and guess what, no more IntelliPoint driver support. I finally spent a day writing an addin that traps the WM_MOUSEWHEEL event and scrolls via code.

  10. Wow! That worked! I uninstalled IntelliPoint 5.1 and installed 4.12 and it fixed it. I have a MS Wheel Mouse Optical on a pc with XP Pro with all the latest updates. VB5 Pro.

  11. yup worked.
    To think all this time I was just…
    simply putting up with it.
    its a …
    Microsoft IntelliMouse optical usb.

  12. I reinstalled WinXP and downloaded the latest software/drivers (5.0) for the IntelliMouse Optical. The wheel didn’t work in VB6 (the horror, the horror). Googled to this page, read your posts and proceeded to download v4.1; It works like a charm.
    Thanks for the link!

  13. Since I re-installed my machine 2 months ago, it’s been bugging me like crazy as to why it didn’t work – Version 5 of Intellipoint just doesn’t cut it.
    Found this link on my first search, and it worked 100%

  14. I’ve had 100% success fixing the scroll mouse problem by using a utility called FreeWheel. If you Google “freewheel scroll mouse”, you will find it. It works in the MS Office VBA editors too. I wish I had found it before I sank a couple days into writing my own addin.

  15. Even though the freewheel home page claims it’s redundant it still fixed my problem with my microsoft mouse. I’m running win 2000 and Intellipoint

  16. THANKS!
    i bought myself a MS wireless desktop elite which only works with lousy intellipoint 5 driver. but this driver does not scroll in VB. without wheelmouse-support, its cranky working in VB6.
    freewheel fixed the problem! thanks very much!

  17. As most of you, I was going crazy without the wheel scroll. Downgrading to v4.12 fixed the problem (reboot was necessary). BTW, Freewheel also worked fine with v5.0 Thanks guys!

  18. I just bought the cheap Microsoft Basic Wireless Optical Desktop and has just become aware of the problem with scrolling in VB. I’ve googled around for a solution but found none. So i tried to revert back to Intellipoint 4.12 but it did not help. As a final desperat effort i installed the Logitech 9.78 driver and what do you know, now my scrolling in VB works. So what can i say, Microsoft can not make their own hardware work with their own software, so Logitech has to come to the rescue …

  19. I recently bought the new wireless optical intellimouse with the side scrolling support, but soon discovered that the new intellipoint drivers didn’t let me scroll at all in vb6. I downloaded the FreeWheel program mentioned and it works beautifully 🙂

  20. You can actually use any text editor to edit your code, as the source files generated by VB are, infact, text.
    Let’s not forget the context for VB – it is taken from BASIC = Beginners All Symbolic Instruction Code. Basic has been around years, and was never intended as a serious development language – it was (and still is to some degree) a training language.
    Though VB is definately a lot slower than C++ and Pascal (Delphi), it is still very easy to program with, and some professional looking projects can be developed very quickly.
    Please remember the old “Horses and courses” or “Different strokes for different fokes” sayings before criticising something.

  21. I have been looking for a fix for the scroll problem for about six months (on and off). I have an MS wireless optical mouse 2.0 (the one with the horizontal scrolling). It’s amazing how many user groups and message boards have people saying “install the newest drivers” and don’t seem to be able to comprehend that this doesn’t work. Freewheel is great, I had heard of the intellipoint 4.12 fix before, but that was no good for this mouse, a friend had also discovered the logitech fix, which i could get to work at work but not at home. Thanks to Brian, who I think first suggested this utility.

  22. For those of you who would like to use
    the latest Intellipoint version, but still
    have the vertical scrolling in VB work properly,
    check out Knowledge Base Article 837910.
    It includes a neat little add-in for VB that
    fixes the problem.

  23. In the above sequence of rants and follow-ups, someone mentioned “being able to hold your cursor over the variables in the code to see the current value”.
    I absolutely rely on that feature, so imagine my frustration at it sometimes not working now. I’ve had it kick in after waiting a minute, and other times not at all. I’ve found that if I hit the Alt key it will make it kick in, but of course that also has other undesired focus consequences.
    I’m using VB6 (sp6), in XP-pro (sp2).
    Thanx in advanx
    PS So glad that with your help my scroll wheel works now!

  24. VB6 allows more edit and continue than by breaking running program and changing and running again, but cant resave until stopped.
    Some and /or too many changes make you restart prog still. Its setup wiz makes deploying w/ runtime seamless.
    I still havent got that figured out with yet. VB6 progs misses standard controls, now found in, that would have been nice to have 4-5 years ago and that I dont think are in the other languges to date.
    My Dad started learnin this vb6 stuff a while back and came to me one time and mentioned, “I put the scroll bars down on the form, but they don’t do anything.” That’s the nature of VB6.
    Apps are easier to write than in other languages but some stuff like that is just silly. I’d first want a panel with scroll bars than just the bars themselves. But all good things in time.
    Just wait one day a few years out (when everyone’s ready for the later framework) we can stick to making websites when we want just a website and have rich applications be web-based, secure, client-server type, web-page-like deployable programs.
    It will be nice for these programs to be solely dependent on a single framework, and no need for 3rd party stuff, unless the needs of the app are truly unique versus going to 3rd party for somethin that should be in the framework/runtime already but isn’t or has bugs.
    Im gonna look for that wheelmouse add-in, didnt already consider there might be some add-in for that, but it’s been real annoying…
    The syntax checking setting can be turned off in the options so not so annoying anymore, the line still highlights red which I rely on all the time.
    I have on auto-save on every project run in case of crash and make little change while running unless helps me debug, then stop and resave soon… Too me it’s less frustrating to take out unwanted code, than to put it back in. I love code completion and wouldnt want to take it out usually because it helps me type lines of code faster, but when new to something – helps to learn from – I call it “fishing for whats available” – instead of learning first how to code somethin’ – some times I lay down the object, start runnin with it, and see what its made of at run-time.

  25. Posting on old blog entry!
    You think VB6 is bad? Try eVB. It was so bad Microsoft just said “here! Take it free! But we’re not giving any warranty”. They gutted the VB6 environment and used VBScript and made it build code for PocketPC. But here’s the problem:
    It was SO closely related to VB6’s environment that even the popup help included the same keywords that are available in VB6. So here I am wanting the left X characters of a string. So I start to type left… oh good it’s there. Gives you the definition of Left() and all. Highlighting which parameter you’re dealing with in the tooltip.
    Then you go to run it… and get some bullshit about arrays. What’s the problem? VBScript doesn’t HAVE Left() or Right(), only Mid()! But it gives you the info on Left() ANYWAY.
    Oh and eVB had a known major memory leak. You could never successfully delete objects. The solution? Make your objects global and instantiate them ONCE. So yes, your database recordset objects would be a global variable.

  26. Has VB even gotten regular expressions yet? Even Dreamweaver has that.
    To me, the only good thing about VB is that VBA is in Word and Excel. What if you are at your aunt’s house and she needs to flatten a mailing list for the sewing club? No probalo, new macro.
    The stupidest thing about VB is the way a string search returns 0 for not found instead of -1. Good thing the debugger is so robust, you need it to do anything. End if. Ugh.