Monday, February 8, 2010

Post Build Copying

Often we want to copy a dependent DLL to an output directory. This can often slow up our builds because after every build, we have to wait for the dlls to be copied. If we use xcopy with "\D" flag we can speed up our build times:

For example:
xcopy "\OpenCV2.0\bin\cv200.dll" $(TargetDir) /D
xcopy "\OpenCV2.0\bin\cxcore200.dll" $(TargetDir) /D

MFC Doxygen Compatibility Note

A conflict between the two will cause this code to be misread and mark all your public variables as private. This is really bad because most doxygen outputs hide privates, causing all your functions to vanish, and if they do display, they will be marked as private which is just wrong.

class foo : public CWnd
{
DECLARE_DYNCREATE(foo)

public:
...
};

So, it is very important that you add an semicolon [;] after the dyncreate macro:

class foo : public CWnd
{
DECLARE_DYNCREATE(foo); //Semicolon added here

public:
...
};

Doxygen Function Commenting


A few tips when setting up your function comments for a Doxygen generation:

If you have visual assists, I highly suggest creating a Snippet. You may do this under VA Options:

My Snippet looks like this, and I mapped it to Ctrl + D:

/**
* $SymbolName$
*
* \return $SymbolType$
* \param $MethodArg$
*/

Once you create the snippet you can autogen most of the work for you when documenting a function:

It is important to then fill out the comment with the specific information. The first line will be the short description of the function. Any information after that will be displayed in the long description section. Each variable and return may also be commented, any input or output you do not want to comment, should be deleted from the comment. For example, if the function returns a void, the auto complete will generate the code "* \return void", which should always be deleted. After filling out the comments my function now looks like:


Notice I added an \sa field, which stands for see also. This will allow for a direct link in doxygen to the function that is used to populate the ImageStruct before it is received.

Finally my Doyxgen output for the following function looks like this:


Friday, February 5, 2010

Starting My Coding Blog

For those who want coding suggestions. Particularly I need a place to track coding practices and tips at my job so I created this.