Pete Wright's Radio Weblog
Musings on anything and everything, but mainly code!

 

 

16 July 2004
 

Beginning Visual Basic 6 - what a book. What a fantastic book. You all seemed to think so as well, buying hundreds of thousands of copies (thankyou thankyou, no I'm not rich, but I was young and very stupid - work it out).

Well, the next book is going to be on a par. The plan is done. The editor seems to like it (you do like it Dom don't you?). It's going to be a nice weighty 1000 page tome with 22 chapters and it's going to be indispensible if you use the tool the book's all about.

The intro is nearly finished (I write the intro first since I find it helps me set the tone and audience for the book), and I've got a stack of notes to write up to get Chapter 1 done ASAP. It's looking very very very very very very cool.

Now all I need is an extremely competant guru like tech reviewer to make sure I'm not talking crap. I have just the right person in mind but he doesn't know it yet, so mums the word.

 


2:20:32 AM    comment []

After playing a few great games of Links and Project Gotham Street Racing 2 (catch name) last weekend with Jason Bock and James Avery, I was especially interested to read his piece in MSDN a couple of months ago about 10 must have tools for .NET developers. The piece has since been republished (and I hope James really stung them for reprint royalties on that one, hehe) online at http://msdn.microsoft.com/vstudio/default.aspx?pull=/msdnmag/issues/04/07/musthavetools/default.aspx. It's got a rating of 8 so far - nice going James.

One tool mentioned in the article is Regulator, a neat app designed to make working with, and writing, regular expressions a lot easier. But, it's a stand alone tool. I agree with James, it's a fantastic tool, but if I'm writing code in Visual Studio that needs to use Regular Expressions it just feels so darn wrong to have to Alt Tab out to some other app to do my testing. I got to discussing this with James yesterday and the idea of writing a Visual Studio plug in came up. I've been thinking of diving into learning how to do that for quite some time and neat little RegEx tool seems ideally suited. Basically it will run as a tool window (just like the solution explorer, task list, properties window and so on) in VIsual Studio and allow you to key in a RegEx. That RegEx will then run over the currently opened document and display results in a list within the tool window. If you use pattern groups (is that what they are called) then each pattern group will also be shown so you can easily make sure that you're RegEx groups just the right information you need. Ultimately, you'll also be able to search RegExLib's extensive RegEx catalogue (they supply a webservice for just that very thing - good on them) and also when running an expression be able to click on matches and have them highlighted in the open document.

Since I've never written an add-in, some research followed. Add-ins in Visual Studio use COM and scripting. For example, the Properties tool window is really a COM ActiveX control hosted inside a window of Visual Studio's creation. So, to develop an add-in that lives as tool window in VS, you need to learn how to create ActiveX controls in .NET right? Thankfully, no. If you head on over to msdn.microsoft.com/vstudio, click on Downloads and then click on Code Samples you'll see a heading that takes you to a bunch of add-in sample code. Microsoft also supply a fantastic ATL control called VSUserControl which is a container for .NET managed user controls. Adding a new tool window to Visual Studio then involves little more than instantiating the container in your add-in project's OnConnection handler, letting VS know about it, and then dropping a user control right into the container. Fantastic stuff. There's a little more to it than that of course, but not much, and it really didn't take very long at all to get a basic toolwindow up and running for RegExinator as it's now known.

Of course, it's very early days, and the layout and design is all wrong and nasty, but it's a great step in the right direction. I'll be setting up a GotDotNet workspace for the project pretty soon so that you all can take a look. James has also threatened to help out, which I'm very grateful for, although I am a little nervous about such a guru seeing my code.

Despite all of that though, I did run into some really peculiar problems that needed solving, not with .NET, but with Windows XP. First up, when you create an Add-in Project in Visual Studio, the add-in project wizard actually goes ahead and sets up the necessary registry keys for VS to pick up the add-in and runs regasm on the resulting add-in binaries so that you're already to start coding and debugging. I didn't realize this in my eagerness to get something on screen and when the add-in promptly crashed on first run with Visual Studio asking me if I wanted to remove it as a result, I stupidly said Yes. Bye bye registry keys. Bye bye regasm's hard work. It took some digging around but to get over this I simply ran regasm on the assembly again, then went into RegEdit and searched for HKEY_CURRENT_USER/Software/Microsoft/VisualStudio/7.1/Addins and added a new key referencing my assembly and the startup class. In this case the new key is called RegExinator.Connect.

WIth that out of the way I was at last able to write my code and debug it. Hitting F5 runs a new version of Visual Studio where I can use add-in manager to kick off the add-in and step through it, breakpoint it etc to my hearts content. Then I got hit by the big problem.

I don't know what I did, or how I did it, but suddenly when I tried to add new classes to my solution, Visual Studio started complaining about "Automation Server unable to create object". I rebooted thinking I'd obviously borksed up the container control (it's actually called a Shim control) somewhere along the line. No joy there. I loaded up a different project and tried adding a new class to that. Same error. I tried creating a new project and ended up with an empty solution following exactly the same error. Visual Studio appeared to have died on me completely and I broke out in a hot sweat at the thought of uninstalling and then re-installing all the express products, Whidbey and Visual Studio.NET 2003.

Windows rules the desktop all over the world because of the volume of users it has (eat number dirt Linux-monsters). This means that it's incredibly unlikely that you'll ever run into a problem that's not been found, and solved, before. A quick scoot around Microsoft's support libraries confirmed this. Visual Studio uses a huge amount of scripting behind the scenes. When you add a class or a form to a project, scripts run to create that class, or build an empty form for you. The error I was getting occurs when the Scripting Engine in XP has been corrupted. Like I said earlier, no idea how that happened, but it did. The solution was to download version 5.6 of the Windows Script engine and install it. A quick reboot later and everything was back as it should be.

Fun fun. Anyways, I'm having a ball learning all about what I can and can't do with add-ins and of course getting the add-in working across the board in 2003, Whidbey and Express. I'll let you know when it gets uploaded somewhere public, and yes, of course it will be free and open source.


2:15:29 AM    comment []

Repeat after me ..

 

OPEN SOURCE DOES NOT MEAN LINUX

OPEN SOURCE DOES NOT MEAN LINUX

OPEN SOURCE DOES NOT MEAN LINUX

 

Here's another mantra for yah..

LINUX (sorry GNU/LINUX - sheesh) IS A BLATANT RIP OFF OF A COMMERICAL OPERATING SYSTEM THAT CRIPPLED SALES OF THAT OPERATING SYSTEM AND THUS PUT THOUSANDS OF PEOPLE OUT OF WORK. LINUX HAS THUS BEEN A MAJOR CONTRIBUTOR TO JOBLESSNESS IN THE 90s.

The Linux people believe Microsoft should be split up, that Microsoft should release the source code to its products for free to everyone, that Microsoft should encourage other people to compete by giving them their trade secrets.

 

In short, the Linux crowd wants, once again, to puts tens of thousands of people out of work, get something for nothing, and then no doubt royally mess it up by sticking 101 different flavours of user interface on it before complaining that people in the real world "just don't get what we're trying to do".

 

Nasty gun toting narrow minded short sighted hippies.

 

Open source, and Free software thrives on Windows. Microsoft encourage it with easy to read and learn documentation and tools, much of which is available for free. When I buy I car I want to travel, not learn how to put the damn thing together after first inventing a new form of screw.

 

 

 

 


1:46:04 AM    comment []

Microsoft have posted up 15 pictures of TechEd Europe 2004. Given the amount of hits I'm still getting from people wanting to look at the ones I took I guess there must be some demand out there. I'm being cynical of course, it's late. So, if you want a flood of nostalgia and involuntary gasps of "Yeah, I was there", head on over to www.microsoft.com/europe/teched/highlights/1.htm

 


1:15:16 AM    comment []


Click here to visit the Radio UserLand website. © Copyright 2004 Pete Wright.
Last update: 27/11/2004; 12:29:03.
This theme is based on the SoundWaves (blue) Manila theme.
July 2004
Sun Mon Tue Wed Thu Fri Sat
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
Jun   Aug