CamStudio TODO List

There had to be one, right? In no particular order: Scratch that. Add to the top - the nail that sticks out gets the hammer. ;)

Table of Contents

  1. Sub-projects
  2. Coding Conventions
    1. Naming Conventions
    2. Brace Layout du jour
  3. Projects & Solutions
  4. Notes

Sub-projects

Remember to look for TODOs to find what to do!

Coding Conventions

Code layout needs to be standardized.

Naming Conventions

Use Hungarian notation for variable names, please!
Data type Naming example
int iValue
char chChar
long lValue
unsigned int uValue
WORD wValue
DWORD dwValue
CString strValue
csValue (if STL string)
struct X sxValue
X * pxValue

Brace Layout du jour

if (<exp>)
{
	<stmt list>
}
else
{
	<stmt list>
}
Early exit in if statements is fine, but only if they have no "else"
if (<exp>)
{
	<stmt list>
	return;
}
// there is no else here!

Projects & Solutions

Notes

CEditTransparencyDlg and CTransparentWnd

The interaction between these 2 classes is artificially convoluted.

In order allow the edit dialog to update the calling CTransparentWnd the dialog overloads PreModal() to pass pointers to the CTransparentWnd window and its members that control transparency. Then as the user edits the values the dialog calls CTransparentWnd::InvalidateTransparency to update the image. All this was done using pointers and casts. Ugh. The dialog class has been changed to force the caller to use the constructor to pass in references to the control values it uses and a pointer to itself. As before, the dialog will call CTransparentWnd::InvalidateTransparency when the values change.

What should be done is to pass the new values as arguments to CTransparentWnd::InvalidateTransparency(bool bEnable, int iLevel) and let it deal with its own internal state. The call to the edit dialog should simply pass in the current state values and copy the new state after the dialog completes. Note that the dialog still retains the old values and restores them on cancel.

warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning)

Here is the quick fix, but it doesn't really deal with the fact that the type of iTemp should be bool.

int iTemp = 0;
f(iTemp ? true : false);
Valid XHTML 1.1 Valid CSS!