Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
inet
active_desktop
active_scrptng
asp.components
asp.db
asp.general
comctl32
comp.packaging
components.dev
dbweb
dhtml_editing
docobjects
html_authoring
html_objmodel
iis
iis.ftp
iis.security
iis.smtp_nntp
indexserver
misc
mshtml_hosting
scripting.jscript
scripting.vbscript
sdk_setup
shell_objmodel
urlmonikers
webbrowser_ctl
wininet
  
 
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:363fcab3-040b-48bc-a6ba-374141424bd2@e6g2000prf.googlegroups.com
>     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);

pEle is a NULL pointer. Check the code that obtains it, figure out why 
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: Tue, 25 Mar 2008 23:45:36 -0400   author:   Igor Tandetnik

Re: get_outerHTML error and pop up mshtml.dll 0xc0000005 access violation   
hi,igor ,thank you in advance

> pEle is a NULL pointer. Check the code that obtains it, figure out why
> it fails.
> --
pEle is not NULL pointer. i get it normally in two way.

these two method ,the code is the same,but one success one failed
and the different fragment is the method in get IWebBrowser2 pointer.
date: Tue, 25 Mar 2008 21:10:28 -0700 (PDT)   author:   victorzou

Re: get_outerHTML error and pop up mshtml.dll 0xc0000005 access violation   
"victorzou"  wrote in message
news:384fba17-865e-4728-ab7c-e152381d9292@s19g2000prg.googlegroups.com
> hi,igor ,thank you in advance
>
>> pEle is a NULL pointer. Check the code that obtains it, figure out
>> why it fails.
>
> pEle is not NULL pointer. i get it normally in two way.

Is too. Interface pointer is passed to the method in ECX register, and 
you show ECX=0 for the call that crashes.
-- 
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 00:24:28 -0400   author:   Igor Tandetnik

Re: get_outerHTML error and pop up mshtml.dll 0xc0000005 access violation   
Igor :
> (IWebBrowser2*)pView->GetApplication();
is any problem in the way of get the IWebBrowser2* get form
IDispatch* ?
let me check it with QueryInterface
date: Tue, 25 Mar 2008 21:35:45 -0700 (PDT)   author:   victorzou

Re: get_outerHTML error and pop up mshtml.dll 0xc0000005 access violation   
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 .
date: Wed, 26 Mar 2008 01:36:28 -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

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us