By deleting your OP it is not easy to find the problem, your code for the question was
kartikdasani wrote:
CString p;
m_editbox->GetWindowText(p);
CWND *c = FindWindow(NULL,p);
Also the title is no lucky choice, because I think the problem is not the conversion from
CString
to
LPCTSTR
.
The call to
FindWindow()
is correct, when it is inside a
CWnd
derived class. But you should look at the description of
CWnd::FindWindow()
it will only find top-level windows, not child windows.
As <removed class="Error">CPallini already posted, give us more details.