Microsoft Visual Studio 2005 Express Editions



Recently I finally took the plunge and installed the express editions of Visual Studio 2005 on one of my machines. The whole process was very painless I must say, the whole process of installing VC, VCS, VB and SQL 2005 didn’t require a single reboot, and didn’t present any installation options at all. It’s worth noting that many tools don’t install with Express Editions, however these too are a free download within the .NET Framework 2.0 SDK.

Happily the whole kit and caboodle seems to run along side old versions of development tools, such as Visual Studio 6 and SQL 2000 etc without any gripes.

I was eager to gain some ‘hands-on’ with C#.NET and VB.NET, which for all intensive purposes seemed pretty easy to grasp. Exception handling is a bit of a revelation if coming from a VB6 background, which is where most of my ‘commercial’ day-to-day work happens, who said VB6 was dead?

Aside from looking at the .NET 2.0, I was also particulary interested in Visual C++, being the last language that is now able to compile native applications (VB is .NET only). Herein lay my first dissappointment with the Express package, support for native applications in C++ appears to be limited to console applications only. I can’t knock Microsoft for ’steering’ developers towards .NET, especially after providing such a rich free development environment, but as much as I don’t want to commercially write VB6 forever I also don’t want to always write .NET applications.

You can get halfway to a working Win32 native application development enviroment by following Microsoft instructions here and/or here. But, and its a big but, at the end of the day you cannot edit resources in Visual C++ 2005 Express. You are left with a very nice development environment for the Platform SDK, albeit without integrated GUI support.

This is a great shame, it leaves the Express Editions in a strange place – somewhere between something too complex for a complete ‘rookie’ programmer, and something not quite useful enough for a more experienced one. Unless of course you are fully on the .NET bandwagon, in which case it’s probably very difficult to justify buying the full product for use purely at home.

MCAD



I’ve finally taken the plunge into the wonderful world of Microsoft Certification, having signed up for an horrendously expensive course for MCAD (Microsoft Certified Application Developer), and hopefully extend this to an MCSD at a later date. I had considered the books & exams only route, but it’s very tedious just sifting through a book, some sort of training structure was in order.

The course will initially comprise of:-

  • 2555 – Developing Microsoft .NET Applications for Windows (Visual C# .NET)
  • 2389 – Programming with Microsoft ADO.NET
    (Exam 70-316 – Developing and Implementing Windows-based Applications with Microsoft Visual C# .NET and Microsoft Visual Studio .NET)
  • 2310 – Developing Microsoft ASP.NET Web Applications Using Visual Studio .NET
    (Exam 70-315 – Developing and Implementing Web Applications with Microsoft Visual C# .NET and Microsoft Visual Studio .NET)
  • 2524 – Developing XML Web Services Using Microsoft ASP.NET
  • 2557 – Building COM+ Applications Using Microsoft .NET Enterprise Services
    (Exam 70-320 – Developing XML Web Services and Server Components with Microsoft Visual C# .NET and the Microsoft .NET Framework)

I’m taking the C# route, although I’ll probably end up taking the Visual Basic exam also, just to broaden my knowledge.

You may ask why bother with the certification at all, after all I have 15+ years experience in C, C++, Visual Basic, Pascal and others. It’s more of a personal achievement thing, and a ‘I told you so’ more than anything else. I’ve also never been in the fortunate position of working for a company willing to provide any formal training.

I did have a preliminary look at some of the course material, and found it rather easy. I do honestly hope I will learn ’something’ from this, after all that is the idea.

Nero 7 and LightScribe Revisited



Since my initial introduction to LightScribe I’ve not had a great deal of time to do anything with it, real life has been getting in the way. In the meantime my desktop has become awash with Visual Studio Express downloads amongst other things, time for a little DVD/CD burning this weekend.

Keeping all my Visual Studio ISOs together on a DVD struck me as a good idea, and thought it would be nice to give it a neat Lightscribe label at the same time.

Somehow between initially installing Nero 7 and now, Nero has forgotten that my drive is a LightScribe drive. It *did* work, and as far as I know, I’ve changed nothing. I do wonder whether because my LightScribe drive isn’t always connected (it’s external USB2) that Nero has ‘flagged’ it in some other fashion. I’ve even gone as far as completely reinstalling Nero to attempt to solve the issue, but to no avail.

The resolution to the problem was to visit the LightScribe site and download SureThing 4SE, which despite it’s horrible name is a very good little dedicated labelling application. I’d even go so far as to say better than Nero for labelling, with a decent selection of standard labels included. Remind me, why did I buy Nero 7?

The Daily WTF



I’ve recently been steered towards a wonderful website called The Daily WTF which is maintained by Alex Papadimoulis. The site contains some of the most hilarious code you are ever likely to read, a lot of which is accredited with being source from ‘Enterprise level’ commercial packages.

It really is a site that every programmer should be conversant with, and should you find any of your code published there, you might think about a career change.

That said, I’ll leave you with a short snippet of a bizzare line of code that I somehow managed not so long ago…..

If iif(IsNull(rs!id, -1, rs!id)) = -1 Then ...

… hopefully this proves we are all fallible ;)

Geniuses and Easter Bonnets



I made some promises to myself when I started this blog, not to turn it into a ‘diary’ or ‘rant’, I guess this post breaks both of those.

It has been an extraordinary month for me, starting with my application for position of ‘Programming Genius’ with a new company. It’s not often you see anyone advertising for a genius, I guess curiosity got the better of me, so I applied. That said, I was looking for new work at the time anyway, it’s not as if this was a completely impulsive action.

To keep a short story, well… short, I booked the morning off work as holiday to attend the interview. By lunchtime I was signing a contract with the new company and duly turned up at my current workplace in the afternoon, with my notice in hand. The only disappointing aspect of the whole experience is that ‘genius’ won’t be appearing on my contract, guess I’ll make do with ‘Programmer’ – no doubt ‘genius’ will appear somewhere on my CV though ;)

Forward wind to Friday morning, just gone, I’m at the end of my penultimate week at my ‘old’ workplace, working out my notice. Normal morning routine, to be followed by my hours drive into work. I should explain at this point I purchased a brand-spanking-new car on the 1st of September last year, the first I’ve ever had (had a sizable number of jalopies, hire and company vehicles before then).

I live on a main road, parking isn’t possible, so my car in parked around the corner, in a good residential area. Upon walking round the corner my heart sank, yes my shiny new car had been broken into, and then I laughed. I never kept anything of value in the car whatsoever (past experience taught me the hard way), the reason for my laughing was what they had stolen, the car bonnet.

Of course it was duly reported to the police, who I’m sad to say stated up front that they wouldn’t be attending as “there were no cameras on the road”. I’m sorry, but a crime has been committed here, and I’d guess at a slightly more unusual one at that. Almost certainly a ‘professional’ job, telltale evidence of windows being taped before being smashed, amongst other things. Within two hours the ‘grapevine’ had told me where my bonnet had gone to, further investigation and behold there was indeed a ‘chop-shop’ that just turned out another car, the exact same make and model as mine.

Of course the police had nothing to do with any investigation, after all aren’t they now just there to collect crime statistics and send out leaflets, informing you how to not become a victim? In case you hadn’t guessed I’ve lost all faith in our police force.

SFF design is getting interesting



Shuttle has been the de-facto SFF PC for some time now, it’s not difficult to see why. The cases are small, elegant and I believe most importantly – customisable to an extent (i.e. you can select from various standard components to build a machine).

However with the advent of the Mac Mini, Shuttles are starting to look rather large.

The market is full of ‘Media Centre PCs’, but most that have become available recently resemble cheap plastic hifi units, or Shuttles.

Hoojum Nanode

Two units have stood out from the crowd, the Kapsel Multimedia and the Hoojum Nanode.

Kapsel Multimedia

Of course, as my luck would have it, neither seems to be available as yet. Let’s hope when they are released they don’t have a ‘Media Centre PC price tag’, which seems to add anywhere between £200 and £400 to the cost of a normal PC. The jewel in the crown would be a good flexibility on configuration/customisation. I know I’m asking a lot, but trust me the first to market with a unique product like these two and flexibility is going to rake it in.

The dimensions of these units are truely remarkable:-

  • Average ATX PC – 540×198x458mm
  • Shuttle – 325×220x210mm
  • Kapsel – 270×230x100mm
  • Mac Mini – 165×165x51mm
  • Nanode – 95×150x150mm

Make me a Nanode with an Intel Core Duo CPU, a passively cooled graphics solution of nVidia FX5200 power or greater, 160GB+ HDD, WiFi/Bluetooth and plenty of USB2 connections and you’ll have a customer tomorrow.

Passing ADO Connection objects between processes



I was posed an interesting problem today, a colleague was debugging some Visual Basic 6 code, and coming across the following error:-

“Run-time error ‘3001′: The application is using arguments that are of the wrong type, are out of acceptable range, or are in conflict with one another.”

The error was occuring when assigning the ‘ActivateConnection’ property:-


Public Function MyFunc(objConn as ADODB.Connection) as Boolean
 
Dim objCmd as New ADODB.Command
 
Set objCmd.ActiveConnection = objConn

Nearing the end of a seemingly fruitless search for the answer (it would seem error 3001 occurs for all sorts of reasons), the answer was stumbled upon.

The connection object was being created in an EXE and being passed to the function in a DLL, herein lay the problem. Apparently, you cannot pass an ADODB connection object between processes. This is the reason it ran correctly when complied, as the DLL became part of the EXEs process, when debugging in Visual Basic two distinct processes existed.

As with all obsure problems like this, there was a simple and elegant workaround. That is to simply debug the EXE and DLL in a Visual Basic group file.

Nero, LightScribe and Robotic Support



I recently upgraded my ageing Pioneer DVR-106D DVD/CD burner, to something a little more up-to-date, a Philips SPD3200 external USB2 unit. Simultaneously, I upgraded Nero to version 7.

The writing speed boost for DVDs is bliss, 4x to 16x is a sizable leap. That’s not to say the drive hasn’t been without problems, this is the second unit I’ve had, the first simply didn’t like CD-Rs.

LightScribe is fantastic for a professional touch for DVD/CDs containing software destined for clients. The price of the media is a bit expensive for everyday personal use at the moment, but can be easily justified for delivery of paid work. I recommend the use of the Extended Label Contrast Utility from the Lightscribe site, if you have the extra time for labelling DVDs. Why the utility doesn’t apply to CD media is a mystery, however you can ‘burn’ the label twice and achieve pretty much the same results.

I’m still sitting on the fence with the Nero upgrade, I was happy enough with Nero 6.6, it was more of an impulse buy when getting my new shiny burner. Overall the interface improvements are great, especially where I spend most of my time – Nero Express. However in a desire to simplify the interface, I think they have maybe gone a step too far, they have moved disc burn speed onto a side ‘tab’ that is hidden by default. I rarely burn at full rated speed to media, so more often than not I need to adjust this speed. I did pose the question to Nero ‘technical support’ (I use the term very loosely), as to whether there was anywhere to setup a default maximum burn speed.

I quote an extract from my email to Nero technical support,

“Overall the interface improvements are great, especially Nero Express (were I spend most of my time). However I have noticed that the disc burn speed has moved onto a tab that is hidden to the left by default. I rarely burn at full drive/media speed as I suspect many others don’t, is there a global ‘maximum burn speed’ setting on a per drive basis? I don’t disagree with the moving of this setting to the tab, I much prefer the cleaner interface, however I really do need to be able to set burn speed quickly. If this setting doesn’t exist, may I suggest it as a future enhancement?”

Their reply was somewhat disappointing,

“Thank you for your email and your interest in our software.

Please have a look at the screenshot in the attachment.
There you can see how to select the speed.
I hope that helped you.
Have a nice day.”

Indeed the attachment did show a screenshot, with a big red circle round the burn speed, yes the same one I’d referred to in my email to them! I understand these technical support departments must be busy, but did they read my mail at all? Maybe they have a system that picks out keywords, and offers the operators stock replies, who knows?

‘DLL Hell’ Strikes Again, GUIDs, IIDs and binding.



I remember all too well wrestling with all sorts of versions of system DLLs under Win3.1. Even resorting to dynamic loads and ‘GetProcAddress’ to determine exactly what my program might be about to do. I thought it was all in the past…..

I’ve been beavering away with a smallish development team developing a new product which, for compatiblity reasons with the ‘host’ application, is developed as ActiveX DLLs using Visual Basic 6. To date there are about 14 individual ActiveX DLLs and other files that make up the product.

Of course we have source control, without which the synchronisation and rapid development pace would be impossible.

A problem occured today with one of the ‘central’ dependency ActiveX DLLs we have developed, a mini .NET library if you will. It is flagged to build as binary compatible and all other ActiveX DLLs early-bind to it. Fair enough you may think.

But what if due to limitations of working with source control, the ‘compatible DLL’ is in a sub folder of the main project and isn’t updated as frequently as maybe it should be. As it happens, part of the interface (IID) that wasn’t in the ‘compatible DLL’ changed between versions. Let DLL hell ensue……

The only viable solution was to break compatibility completely and ‘re-bind’ all dependant DLLs to the new GUID.

Considering the ‘master build’ of the product is done in reverse order, that is dependancies first, it begs the question of whether binary compatibility is really worth the effort anyway. ‘Project Compatiblity’ would preserve the GUIDs and therefore early-binds, any changes to the classes/methods of the central DLL could be tracked via source control, so the correct developer could be thumped should any change produce ‘real’ incompatibilty anyway.

Of course there’s always someone that will pipe up about the advantages of late binding, but for the purpose scale and speed of this project early binding is almost essential.

Getting started on PlusNet CCGI



This is a guide intended to cover the basics of PlusNet’s ccgi server and it’s perculiarities. It is not a guide to cover installation of any specific package, although the information here can be used to successfully install packages such as PhpBB, WordPress, Gallery and many others.

Activation

By default you do not have any CCGI space at PlusNet, you need to activate it via your portal. CCGI and MySQL require seperate activation. In the case of MySQL you will receive an email with a database name and password once it is setup. For CCGI, you use your normal username and password, but bear in mind you can only access CCGI from your PlusNet connection for many tasks (this is for security reasons).

PHP Location and Permissions

PHP files can be FTP’ed to your CCGI space using ftp://ccgi.plus.net. Do not put PHP files in the cgi-bin folder, unlike the homepages server there is no ‘htdocs’. You can put files in the root or create folders yourself.

Permissions of PHP files are specific to PlusNet’s setup, you must have owner execute permission set for files to run correctly, public execute will stop them running. Many FTP clients have a permission or CHMOD facility for files, basic permissions required are ‘740′. When installing packages, it is often easier to follow the guide with the package with regard to permissions, then run the ‘fixphpperms.sh’ script provided by PlusNet before any step that requires using a PHP page for configuration.

To execute ‘fixphpperms.sh’ via telnet

  • Start->Run->Cmd
  • In the command prompt type ‘telnet ccgi.plus.net’ and hit return
  • Login using your normal username and password
  • Type ‘fixphpperms.sh -r’ and hit return
  • Type ‘exit’ and hit return to leave

‘Fixphpperms.sh’ takes a number of parameters:-

  • -c will fix all .php files in your current directory AND all subdirs
  • -r will fix ALL .php files from your homedirectory down
  • -s will fix all .php files in your current directory only.

MySQL

MySQL is located on ‘rumpus’ or ‘humbug’ server, you will be notified which when it is activated. Note that you have a new password just for MySQL and a database name. All packages that use MySQL require these connection details to work, and are often sorted in a file called ‘config.php’ or similar (your package will detail which file to edit).

Basic MySQL connection from PHP is as follows:-
function opendb()
  {
    $db_host  = "humbug";
    $username = "username";
    $password = "password";
    $DB_name  = "databasename";
 
    $chan = mysql_connect ($db_host, $username, $password);
    mysql_select_db ($DB_name, $chan);
 
    return $chan;
  }

NB. ‘Humbug’ could be ‘Rumpus’, and will never be ‘localhost’ as most packages specify by default.

Once you have made the MySQL connection you can query the database:-

$chan = opendb();
$result = mysql_query("SELECT * FROM myfirsttable", $chan);

… then interrogate $result with one of the ‘mysql_fetch’ family of PHP functions.

As I said at the beginning, this is only intended as a brief overview/guide. Other topics, some more advanced can be found in the PlusNet category of this blog, the UserTools tutorials and of course PlusNets own help. It’s also worth hunting around the forum signatures of the regular users of PlusNets Webspace Help forum, which often contain very useful information!