I have created a ModalDialog using thread

void CMenuDlg::OnBnClickedOk()
{


HANDLE hCommReadThread = CreateThread(NULL, 0, ThreadFunc, NULL, 0, NULL);
//hCommReadThread = CreateThread(NULL, 0, ThreadFunc, NULL, 0, NULL);

if (hCommReadThread != NULL)
{
CloseHandle(hCommReadThread);
hCommReadThread = NULL;
}

return;
}

DWORD WINAPI ThreadFunc(LPVOID lParam)
{
//Ctest oTest; Declared globally
oTest.DoModal();

return 1;
}

How can I now close the dialog on click of some button?