Beginning Objects in VB - Part 2
In the first part of this tutorial, we built our project into a DLL from VB. Now, because VB is nice and cares about its users (yeah right!) it automatically registers the DLL on your machine when you build it. This saves a lot of hassle, but hides the fact that it does that.
So, when you come to distribute your DLL to your friends machine and he complains that it doesn't work, you haven't got a clue why.
Each DLL (or component) on your machine has to be registered (including controls). Once registered, an entry in to the registry is made, but I don't suggest the best route is to dive into the registry and try and do things in there (many a machine has died from that treatment)
How do we do it then? Well, there are several ways. Luckily for you, some guys have already thought about this and put together a nifty little tool which not only allows you to register components, but also to unregister them! So now when you friend gives you his "I am the best programmer in the world" component which flashes up a message box every five seconds saying just that, you can now unregister it!
(Your friend: Time to die Mr Huggill!)
OK. So who are these guys and where can I get this cool tool? Well, they are a bunch of awesome programmers who are part of a project to replace the standard VB controls with better ones, and to provide some handy controls as well. The CCRP (Common Controls Replacement Project) has been around for sometime, and is somewhat a hero amongst many programmers (me included!)
You can visit their web site by: clicking here If you want their registration utility, then look under the Cools Tools page for CCRP Reg Util.
I will quickly take you though using it.
After you have downloaded and unpacked the files, run the exe file ccrpregutil.exe and you will see the following screen:
Simply click on Specify File, select either a DLL or OCX file and click OK and Register or Unregister (depending on how much you like your friend)
Easy. And, if you want to register your component when you put it in your setup program, don't worry! The Package & Deployment Wizard that comes with VB does that for you.
Right, enough about registration, lets do some properties!
Page 3 of 4