Board index » Visual Studio » Searching inside a CHtmlView?

Searching inside a CHtmlView?

Visual Studio103
Is there a way to do this? could someone point me to the right

direction otherwise. I don't see any Find methods for this class





thanks


-
 

Re:Searching inside a CHtmlView?

Use IWebBrowser2's object model and iterate over all IHTMLElements and

then you can find what you want. I think AliR will provide you with the

code shortly.



---

Ajay



-

Re:Searching inside a CHtmlView?

Hi Kourosh,



Do you want to do the search yourself, or do you want CHtmlView to do it for

you?



This code will bring up the IWebBrowser2 find window.



void CMyHtmlView::OnEditFind()

{

UUID Uuid;

CString GUID1 = ("ED016940-BD5B-11CF-BA4E-00C04FD70816");

UuidFromString((LPBYTE)((LPCSTR)GUID1),&Uuid);

if (m_pBrowserApp != NULL)

{

CComPtr<IDispatch>spDisp = GetHtmlDocument();

if (spDisp != NULL)

{

CComQIPtr<IOleCommandTarget>spTarget = spDisp;

if (spTarget != NULL)

spTarget->Exec(&Uuid, 1, OLECMDEXECOPT_DODEFAULT, NULL, NULL);

}

}

}



If you want to do the search yourself then let me know. (it's a bit longer

solution for that).



AliR.



"Kourosh" <kderakhshan@msn.com>wrote in message

Quote
Is there a way to do this? could someone point me to the right

direction otherwise. I don't see any Find methods for this class





thanks







-

Re:Searching inside a CHtmlView?

wow thanks again Ali :)

I'm going to try this soon. No I don't want a custom search. Thanks a

lot :) :)



-