Visual Basic 6 on Win­dows 7: DBGrid32.ocx Issues

January 26th, 2012 1 comment

    Unfor­tu­nately, I’m one of those poor pro­gram­mers who is forced to main­tain some pretty old appli­ca­tions writ­ten in Visual Basic 6.  Thus, it was imper­a­tive to get the IDE work­ing on Win­dows 7. When I looked into this issue two years ago, I found an infor­ma­tive post cov­er­ing the basics over at Forty­Pound­Head. The instal­la­tion guide works pretty well except you don’t need to turn off UAC first. So here’s a short sum­mary on how to install VB6 on Win­dows 7.

    1. Cre­ate an empty file in your Win­dows direc­tory called MSJAVA.DLL. This is to skip the install of this very old MS Java thingy which even requires a reboot.
    2. Run setup.exe as admin­is­tra­tor and install the needed components
    3. Install the Ser­vice Pack 6
    4. Install the Visual Basic 6.0 Ser­vice Pack 6 Cumu­la­tive Update

    Step 4 is the cul­prit that breaks your DBGrid. It will cause your DBGrid con­trols to lose any infor­ma­tion like data sources, lay­out set­tings, and so on. So before you pro­ceed with step 4, make a backup of %windir%\system32\dbgrid32.ocx. After installing the SP6 Cumu­la­tive Update, replace the newly installed DBGrid32.ocx with the backup you’ve cre­ated ear­lier. Now reg­is­ter the OCX via regsvr32. Every­thing works fine again.

    Alright, this is a dirty hack. It’s def­i­nitely bet­ter to sim­ply get rid of this con­trol or even bet­ter yet – upgrade to a newer Ver­sion of Visual Basic. If you’re like me and you can’t migrate to a newer ver­sion though, it might help you get around this issue until you’ve replaced all the con­trols. Good luck!

    Add Reg­Exp and Com­ment­Doc High­light­ing for JS to Programmer’s Notepad

    July 13th, 2011 2 comments

      For a cou­ple of days now I’ve been using Programmer’s Notepad instead of Notepad++. It’s smaller, it’s faster, and its mem­ory foot­print is roughly one third of Notepad++. Yes, there are fewer plug-ins avail­able and it’s not get­ting updated as often as its more famous com­peti­tor but guess what – it has every­thing I need. Today I tried to cre­ate a scheme for JavaScript syn­tax high­light­ing that appeals to me. It was very easy and there are only a few very small bugs to iron out.

      Any­way, I wasn’t able to style Com­ment­Doc key­words and reg­u­lar expres­sions. As usual, Google came to the res­cue. After doing some research I found that I had to man­u­ally edit the cpp.scheme file in the schemes direc­tory of Programmer’s Notepad. Look for the fol­low­ing part and add the high­lighted lines to your file:

      <language base="cppbase" name="javascript" title="JavaScript" folding="true" foldcomments="true" foldelse="true" foldcompact="true">
        <comments line="//" streamStart="/*" streamEnd="*/" blockStart="/**" blockLine=" *" blockEnd=" */" />
        <use-keywords>
          <keyword key="0" name="Keywords" class="javascript"/>
          <keyword key="1" name="Keywords 2" class="jsunsure"/>
          <keyword key="2" name="CommentDoc Keywords" class="commentdockw"/>
        </use-keywords>
        <use-styles>
          <style name="Doc Comments" key="3" class="commentdoc"/>
          <style name="Keywords 2" key="16" fore="b00040"/>
          <style name="Comment Doc Keyword" key="17" fore="3060a0"/>
          <style name="Unknown Comment Doc Keyword" key="18" fore="804020"/>
          <style name="RegEx" key="14" fore="3f7f3f" back="e0f0ff" eolfilled="true"/>
        </use-styles>
      </language>
      

      Now we only have to cre­ate the com­ment­dockkw class we added in the code above (sim­ply add the high­lighted lines to your cpp.scheme at the appro­pri­ate position):

        ...
        <keyword-class name="jsunsure">
          undefined
        </keyword-class>
        <keyword-class name="commentdockw">
          <!-- JsDoc tags -->
          augments author borrows class constant constructor constructs default
          deprecated description event example exports field fileOverview function
          ignore inner lends link memberOf name namespace param private property
          public requires returns see since static throws type version
        </keyword-class>
      </keyword-classes>
      

      That’s it. Save the file and start Programmer’s Notepad. Now you’re able to apply cus­tom styling to reg­u­lar expres­sions and com­ment doc key­words. On the Key­words tab you can edit the key­words we defined above.

      Categories: computers Tags: ,

      What Can Call of Duty: Elite Do for You?

      June 6th, 2011 No comments

        Call of Duty: Elite LogoSince the sub­scrip­tion ser­vice for Call of Duty is now a real­ity, it’s time to take a closer look at what we gamers are get­ting out of it. Of course, Activi­sion Bliz­zard is unable to detail most of the paid fea­tures for Elite because the premium-tier ser­vice was designed to be deeply inte­grated with Call of Duty: Mod­ern War­fare 3. Until we are closer to the launch of the game we have to make do with the scraps the com­pany throws at us.

        Call of Duty: Elite is a ser­vice incor­po­rat­ing stats-tracking, social net­work ele­ments, an inter­ac­tive strat­egy guide, and plenty of options for com­pet­i­tive gam­ing. Activi­sion tries very hard to sum Elite up in three words: con­nect, com­pete, and improve. At least it is kind of elab­o­rat­ing on the mean­ing of these three words on the Elite web­site. Suf­fice to say that, in a nut­shell, Activi­sion is not charg­ing for CoD mul­ti­player. Read more…

        Categories: games Tags: , ,

        Deus Ex: Human Rev­o­lu­tion – Revenge Trailer Hits the Web

        June 1st, 2011 No comments

          Yes­ter­day, the lat­est Deus Ex: Human Rev­o­lu­tion trailer hit the web. Titled “Revenge” it is about … well, revenge. Have a look for yourself:

          Of course, you may also want to con­sider the Collector’s Edi­tion. Unfor­tu­nately, it’s only intended for us Euro­peans and since it’s  using Steam­works it might not be a good idea try­ing to import this edi­tion. Deus Ex: Human Rev­o­lu­tion will only get a stan­dard and Aug­mented edi­tion release in North Amer­ica. In order to get all the con­tent offered in the Collector’s Edi­tion Amer­i­cans would have to pre-order the game twice, as mul­ti­ple retail­ers are offer­ing dif­fer­ent pieces of content.

          Deus Ex: Human Rev­o­lu­tion launches on August 23 in North Amer­ica, August 25 in Aus­tralia and New Zealand, and August 26 in Europe.

          Categories: games Tags: , ,

          Call of Duty:Elite and the Monthly Sub­scrip­tion Fee

          May 31st, 2011 No comments

            Aci­tivi­sion Bliz­zarc Inc. is out to charge a monthly sub­scrip­tion fee for the upcom­ing online ser­vice called Call of Duty: Elite. This ser­vice will work with Call of Duty: Mod­ern War­fare 3 and future install­ments of the fran­chise. CoD:E will pro­vide extra con­tent that isn’t avail­able for reg­u­lar cus­tomers and it will be avail­able for pay­ing and non-paying mul­ti­player fans.

            Play­ers will pri­mar­ily access CoD:E through web browsers though Activi­sion is plan­ning to offer apps for Android and iOS devices. Elite will let play­ers track their stats, par­tic­i­pate in com­pe­ti­tions for real and vir­tual prizes, and pro­vide a lot of social-networking options rem­i­nis­cent of e-sports. Appar­ently, stats-tracking and social group­ing fea­tures will be free for everyone.

            Pre­mium Elite sub­scribers will receive a con­stant flow of Call of Duty con­tent, like map packs. Cam­paign, co-op and mul­ti­player modes can still be had for no charge, so going for the pre­mium mem­ber­ship isn’t strictly nec­es­sary. Unfor­tu­nately, details regard­ing the ser­vice are still very scarce. The guys over at Kotaku at least scored some infor­ma­tion on how the ser­vice looks like.

            In short, Call of Duty:Elite is divided into four sec­tions: Career, Con­nect, The­ater, and Com­pete. The first sec­tion is loaded with stats, the sec­ond one offers social-networking options. The­ater allows users to host their favorite Call of Duty videos and Com­pete will allow play­ers to win lots of prizes by let­ting play­ers engage in short-term chal­lenges and long-term tournaments.

            No word on pric­ing yet but accord­ing to the Wall Street Jour­nal Activi­sion exec­u­tives expect the cost to be less than Net­flix monthly movie sub­scrip­tion. That could mean some­thing in the range of $5-7 a month. Not quite pricey, right? Well, as long as we don’t know what to expect from becom­ing a pre­mium sub­scriber that sounds like buy­ing a pig in a poke.

            Call of Duty: Elite will launch on the same day as the Mod­ern War­fare 3Novem­ber 8, 2011. If you’d like to test it before then, try to get an invite to the closed beta which will start later this summer.

            Categories: games Tags: , ,

            User­script Update: Keep­ass Auto­type Enhancer

            May 31st, 2011 No comments

              I finally got around to updat­ing my favorite user­script: Keep­ass Auto­type Enhancer. There were a few things that needed iron­ing out but I think I finally nailed it. In short, the script adds the domain to title bar if it’s not already there and puts the focus on the user­name input field so that you can speed up insert­ing your cre­den­tials via KeeP­ass. It has a few options that can be changed by edit­ing the first lines of the JavaScript code.

              This time around I only did some fine­tun­ing but it still may not work on all sites. For instance, there is a known issue with pages like the Miranda IM Forums. They use an INPUT tag of type text to dis­play a pass­word hint so the user­script will fail the first time. On these sites man­u­ally run­ning the script a sec­ond time via CTRL+ALT+S will put the focus on the user­name field.

              Future plans include some clean-up and opti­miza­tions as well as cre­at­ing a nice graph­i­cal user inter­face to change the set­tings. I don’t know when I’m going to find the time to do all that, though. In the mean­time, enjoy the updated ver­sion of a use­ful Grease­mon­key user­script. BTW, I’m not sure about it but I think this script just might work with Opera too.

              Categories: internet Tags: , ,