I wrote an APP handler for handling all 'file' protocol stuf in the current
process. Basicaly it works but in some caseswebbrowser doesn't read complete
content. (sorry for the long text)
sample: smal html file with embedded mini gif.
first the html file is requested and read completly, than the gif-file is
requested but only the first 200 bytes are read. (The gif is shown in the
webbrowser control but only the top part of it)
a small log of all Interface calls follows:
##
IClassFactory::CreateInstance
IInternetProtocol::Start (file://D:\..\HLP_PSC_DLG_FRM.html) Bind Info
0x00100C21
IInternetProtocol::Read (HLP_PSC_DLG_FRM.html) bytes: 350/4096
IInternetProtocol::Read (HLP_PSC_DLG_FRM.html) bytes: 0/7842
IInternetProtocol::LockRequest (HLP_PSC_DLG_FRM.html)
IInternetProtocol::Read (HLP_PSC_DLG_FRM.html) bytes: 0/7842
IInternetProtocol::Read (HLP_PSC_DLG_FRM.html) bytes: 0/7842
IInternetProtocol::Terminate (HLP_PSC_DLG_FRM.html)
IInternetProtocol::UnlockRequest (HLP_PSC_DLG_FRM.html)
IClassFactory::CreateInstance
IInternetProtocol::Start (file:///D:/../buch10%5B1%5D.gif) Bind Info
0x00121883
IInternetProtocol::Read (buch10[1].gif) bytes: 200/200
IInternetProtocol::Terminate (buch10[1].gif)
##
May be the ReportResult, ReportData and ReportProgress calls has something
to do with this. It's not really clear when should I call what.
Another mysterious thing is the html read cycles. The First read gets all
data. What does the other?
"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken
"Falko Niemz" <ni...@pisa.de> wrote in message
news:eW#4sZ48C...@TK2MSFTNGP10.phx.gbl...
I called first ReportProgress(BINDSTATUS_MIMETYPEAVAILABLE) with the exact
mime type
and than ReportResult (S_OK, 0, NULL).
The BINDF_NEEDFILE isn't requestet in my scenario.
The Webrowser Control showns an error message (break).
Ok I did a debug session.
On the ReportResult call comes immediately a Terminate and thats all.
Than I inserted a ReportData (BSCF_LASTDATANOTIFICATION |
BSCF_DATAFULLYAVAILABLE) call before the ReportResult.
Now the HTML content is read but on the gif file comes millions of reads
with no end.
What's this?
What is about the ReportData call. When should I call this method?
Bye Falko
"Igor Tandetnik" <itand...@whenu.com> wrote in message
news:#DO1hv68...@TK2MSFTNGP12.phx.gbl...
STDMETHODIMP CBitmapAPP::Start(LPCWSTR szUrl, IInternetProtocolSink
*pOIProtSink,
IInternetBindInfo *pOIBindInfo, DWORD grfPI, DWORD dwReserved)
{
if ((grfPI & PI_PARSE_URL) != 0)
return S_OK;
if (!pOIProtSink)
return E_POINTER;
pOIProtSink->ReportProgress(BINDSTATUS_MIMETYPEAVAILABLE,
L"image/bmp");
pOIProtSink->ReportData(
BSCF_FIRSTDATANOTIFICATION | BSCF_LASTDATANOTIFICATION |
BSCF_DATAFULLYAVAILABLE,
m_dwSize, m_dwSize);
pOIProtSink->ReportResult(S_OK, 200, 0);
return S_OK;
}
Works just fine. IInternetProtocol::Read gets called several times
before ReportData returns - be prepared for reentrancy.
--
With best wishes,
Igor Tandetnik
"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken
"Falko Niemz" <ni...@pisa.de> wrote in message
news:O7AFxs78...@TK2MSFTNGP10.phx.gbl...