I don't know exactly how I did it, but I had the same problem, and after some queries I got some answers that basically helped me.
In my dialog based application I've got a function called DisplayWindow and a function called OnWindowPosChanging.

These functions look like

void MyDialog:isplayWindow(BOOL bShow)
{
if (bShow) {
m_bVisible = TRUE;
ShowWindow(SW_SHOWNORMAL);
}
else {
m_bVisible = FALSE
ShowWindow(SW_HIDE);
}
}

void MyDialog::OnWindowPosChanging(WINDOWPOS* lpwndpos)
{
if (!m_bVisible) lpwndpos->flags &= ~SWP_SHOWWINDOW;
CDialog::OnWindowPosChanging(lpwndpos)
}

In my OnInitDialog member function I simply call DisplayWindow(FALSE) to hide the dialog upon startup.
Obviously, you have to declare m_bVisible as a variable of your MyDialog class.

Hope this helps,

Regards,
Rob