I suggest to use PostThreadMessage instead of SendMessage, check PostThreadMessage Demystified
] for reasons. For Documentation see http://msdn.microsoft.com/en-us/library/windows/desktop/ms644946%28v=vs.85%29.aspx
And by the way if you want to invoke a function of your dialog class from your thread, then you need to send the "this"(present dialog object reference) as a parameter to the thread procedure. Are you sure you are doing this? Because in the code you are casting you lParam into an int which baffles me. When you call your threadproc you need to send "this" as "lParam".
With SendMessage the code would look something like :
void ThreadProc(LPVOID lParam)
CCurrentDialog* pDlg = (CCurrentDialog*)lParam;
You can use PostMessage