I using this source code that i take it from MSDN but it has some errore. please help me to solve it.
Code:
ITextDocument *pDoc;
ITextRange *pRange;
ITextSelection **selection = NULL;
IUnknown *pUnk = NULL;
SendMessage(hwnd, EM_GETOLEINTERFACE, 0, (LPARAM)&pUnk);
if(pUnk && pUnk->QueryInterface(IID_ITextDocument, &pDoc) == NOERROR)
{
pDoc->RangeFromPoint(pt.x, pt.y, &pRange);
// ... continue with rest of program
pDoc->GetSelection(selection);
}
Error:
c:\Documents and Settings\Devil\My Documents\Visual Studio Projects\scratch\scratch.cpp(54): error C2664: 'HRESULT IUnknown::QueryInterface(const IID &,void ** )' : cannot convert parameter 2 from 'ITextDocument **__w64 ' to 'void ** '

Problem in using TOM (Text Object Model)
Didac Pallares
typecast the parameter pDoc.
if(pUnk && pUnk->QueryInterface(IID_ITextDocument, (void**)&pDoc) == NOERROR)
Regards
Sudeesh.