Useful Tip For People Using VC IDE

Thought I would share this small bit of info.

I use the visual studio IDE for development of my driver code - and I use
the
ddkbuild bat for compiling it:

http://www.osronline.com/article.cfm?article=43

Something I do which makes organizing my C code much easier is
to declare a class with the same name as my .c and .h files - I just
add a conditional in front of the declaration that is never realized.

For example in my header for a block buffer routine I have this:

#ifdef THISWILLNEVERBEDEFINED_ZT
class ZT_BLOCKBUFFER
{
public:
ZT_BLOCKBUFFER();
virtual ~ZT_BLOCKBUFFER();

};
#endif

And in the .c implementation file I have this (at the top):

#ifdef THISWILLNEVERBEDEFINED_ZT
ZT_BLOCKBUFFER::ZT_BLOCKBUFFER()
{

}

ZT_BLOCKBUFFER::~ZT_BLOCKBUFFER()
{

}
#endif

Now in the IDE I can jump around my various units. By clicking on the
ctor - I am inside the .c file, clicking on the def - I am in the def.

The actual class is created by the VC wizard (which is why it
has a dtor - you could remove it if you wanted to do so). I find it
convienant to let the wizard create the .h and .c for me and do not
care about the dtor being there.

I guess if you wanted to get fancy you could create some sort of plugin
to VC to do all the if-defing for you.

Hope this is helpful to someone.