Hi Skunkhead try this..
CLoginUIDlg Logindlg;
if(Logindlg.DoModal() == IDOK)
{
}
else
{
}
You dont need to check extra conditon for IDCANCEL, As you are saying that the control flow stop after DoModal() then there might be problem in resource file or in OnInitDialog(), put break point into this function and check same.