안녕하세요 만해 입니다.
그동안 웹 로못이란거 만들어 볼려고 CppWebBrowser하고 좀 놀아서요~
타락님의 소스를 빌더용으로 포팅해서
올립니다.
#include <mshtml.h>
//--------------------------------------------------------------------------------
void __fastcall Parse(void)
{
IDispatch * Document;
Document = CppWebBrowser1->Document;
IHTMLElement* HTMLElement;
IHTMLDocument2* pHTMLDocument;
HRESULT hr;
WideString HTML; // <- w_char* 스트링입니다.
WideString Text;
hr = Document->QueryInterface(IID_IHTMLDocument2,(void**)&pHTMLDocument );
if ( hr == S_OK )
{
hr = pHTMLDocument->get_body(&HTMLElement);
if ( hr == S_OK )
{
HTMLElement->get_innerHTML(&HTML);
HTMLElement->get_innerText(&Text);
HTMLElement->Release();
}
pHTMLDocument->Release();
}
Memo1->Lines->Add(HTML);
Memo1->Lines->Add(Text);
}
그럼 이만~ ^^//
|