In that case, just create a message handler for the button using Class Wizard. Assuming you decide to call it something like OnSearchButton and your class for your search dialog is called CSearchDlg, the function would look something like this:
Code:
void CYourMainWndClass::OnSearchButton(){
CSearchDlg searchDlg;
int ret;
ret=searchDlg.DoModal();
if(ret==-1 || IDABORT)
//error occurred
else
//ret contains value passed to EndDialog. Process accordingly
}
That's the basics. If you're looking for something more advanced, email me.