|
|
|
date: Tue, 25 Mar 2008 19:41:25 -0700 (PDT),
group: microsoft.public.inetsdk.programming.webbrowser_ctl
back
get_outerHTML error and pop up mshtml.dll 0xc0000005 access violation
hi,all
my app pop up unhandle exception prompt ,when step into
IHTMLelement::get_outerHTML with following source fragment.
CComBSTR BStrhtml="";
IHTMLElement* pEle;
......get pEle poniter.....
pEle->get_outerHTML(&BStrhtml);
i test it in two way,one success ,and one failed
1. creat a IWebBrowserapp with CoCreateInstance and then get
IHTMLElement pointer, and pEle->get_outerHTML ,it success.
IWebBrowser2* pWBApp ;
CoCreateInstance(CLSID_InternetExplorer, NULL,CLSCTX_SERVER,
IID_IWebBrowserApp, (LPVOID*)&pWBApp);
2.get IWebBrowser2 form CHTMLview and then get IHTMLElement , but
pEle->get_outerHTML error and pop up
unhandled exception : mshtml.dll 0xc0000005 access violation
CHTMLview *pView ;
........get pView pointer....
IWebBrowser2* pWBApp =(IWebBrowser2*)pView->GetApplication();
I check their memory use but i am very sorry for my analyse ability .
1. method one CoCreateInstance memory use
mshtml address 0x42990000-42d03fff
EAX = 00000000 EBX = 09FA0370 ECX = 0C42172C EDX = 0D92EE18(not in
mshtml memory address area,and no error)
ESI = 0D92EE94 EDI = 0D92EFA8
EIP = 00485FA2 ESP = 0D92EE94 EBP = 0D92EFB4 EFL = 00000246
2 method two , GetApplication form chtmlview
mshtml address 0x42990000-42d03fff
EAX = 00000000 EBX = 01A371B8 ECX = 00000000 EDX = 42A58288(in mshtml
memory address area ,and pop up error prompt)
ESI = 0BC7F8B0 EDI = 0BC7F9A4
EIP = 0047F108 ESP = 0BC7F8B0 EBP = 0BC7F9B0 EFL = 00000246
i have to use the second method ,how to deal with this error.
date: Tue, 25 Mar 2008 19:41:25 -0700 (PDT)
author: victorzou
Re: get_outerHTML error and pop up mshtml.dll 0xc0000005 access violation
"victorzou" wrote in message
news:ca40510a-2e8f-4988-a429-ce15e40a1019@s12g2000prg.googlegroups.com
> igor :
> Yes,You are right.
> I query interface and failed.but how to deal with it?
> why cann't i query interface when get IWebBrowser2 interface from
> CHTMLview .
Well, this is wrong:
IWebBrowser2* pWBApp =(IWebBrowser2*)pView->GetApplication();
You should not cast, you should use QueryInterface instead. But it looks
like you have figured ths part out yourself by now.
So, how do you get from pWBApp to pEle? You never showed this part of
your code. Step through it in the debugger, check that you get valid
pointers on every step, find the earliest place where it fails.
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925
date: Wed, 26 Mar 2008 08:31:12 -0400
author: Igor Tandetnik
|
|