Click here to Skip to main content
15,892,005 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: hooks work only for own application Pin
Naveen13-Aug-06 17:29
Naveen13-Aug-06 17:29 
QuestionFunction needed Pin
SandhyaSri11-Aug-06 20:22
SandhyaSri11-Aug-06 20:22 
AnswerRe: Function needed Pin
PJ Arends11-Aug-06 21:33
professionalPJ Arends11-Aug-06 21:33 
AnswerRe: Function needed Pin
Hamid_RT14-Aug-06 7:10
Hamid_RT14-Aug-06 7:10 
Questionlibrary error in program Pin
Y_Kaushik11-Aug-06 18:53
Y_Kaushik11-Aug-06 18:53 
AnswerRe: library error in program Pin
Naveen11-Aug-06 18:59
Naveen11-Aug-06 18:59 
QuestionRe: library error in program Pin
Hamid_RT11-Aug-06 22:28
Hamid_RT11-Aug-06 22:28 
QuestionDefault Protocol Handler ignored in MIME filter? Pin
kevinvh2000011-Aug-06 11:41
kevinvh2000011-Aug-06 11:41 
Hi there,

I've taken Microsoft's example MIME filter (mimeflt.exe on MSDN) and
made a quick change to register it as a text/html MIME filter as opposed
to text/xml.

As a test for some future functionality I plan on putting in, I return
INET_E_USE_DEFAULT_PROTOCOLHANDLER right at the beginning of
my Start() method.

For some reason, when the browser starts up for the first time, it STILL
calls my ReportData() method, then my Read() method, etc.

When I navigate to subsequent websites, it successfully uses the
default protocol handler, and it is no longer calling any of my methods
as I would expect.

Any idea why it's not respecting INET_E_USE_DEFAULT_PROTOCOLHANDLER
when it hits the first web page in a session?

Here's the code for my start method:

STDMETHODIMP CXMLMimeFilterPP::Start(
LPCWSTR szUrl,
IInternetProtocolSink *pIProtSink,
IInternetBindInfo *pIBindInfo,
DWORD grfSTI,
DWORD dwReserved)
{
return INET_E_USE_DEFAULT_PROTOCOLHANDLER;

USES_CONVERSION;
ATLTRACE(_T("Start - url=%s, sti=%x\n"),OLE2T((LPWSTR)szUrl), grfSTI);
HRESULT hr = E_FAIL;
m_grfSTI = grfSTI;
m_bIncomingIsUnicode = false;
m_bSplitUniWord = false;

if (!(grfSTI & PI_FILTER_MODE))
{
hr = E_INVALIDARG;
}
else
{
// get the protocol pointer from reserved pointer
PROTOCOLFILTERDATA* ProtFiltData = (PROTOCOLFILTERDATA*) dwReserved;
_ASSERTE(NULL == m_pIncomingProt);

if (NULL == ProtFiltData->pProtocol)
{
// !! We can't do anything without an interface to read from
_ASSERTE(false);
return E_INVALIDARG;
}
m_pIncomingProt = ProtFiltData->pProtocol;
m_pIncomingProt->AddRef();

// hold onto the sink as well
_ASSERTE(NULL == m_pOutgoingProtSink);
m_pOutgoingProtSink = pIProtSink;
m_pOutgoingProtSink->AddRef();

m_bFirstRead = true;
m_pHTMLBuffer = new CStringDataBuffer(2048);

hr = S_OK;
}
return hr;
}

Thank you very much in advance!!!

-Kevin
QuestionMFC ActiveX control tutorial Pin
BlackDice11-Aug-06 9:39
BlackDice11-Aug-06 9:39 
AnswerRe: MFC ActiveX control tutorial Pin
Reagan Conservative11-Aug-06 11:40
Reagan Conservative11-Aug-06 11:40 
GeneralRe: MFC ActiveX control tutorial Pin
BlackDice11-Aug-06 12:05
BlackDice11-Aug-06 12:05 
AnswerRe: MFC ActiveX control tutorial Pin
Hamid_RT11-Aug-06 22:26
Hamid_RT11-Aug-06 22:26 
QuestionLock a file / Directory Pin
sundar15611-Aug-06 9:38
sundar15611-Aug-06 9:38 
AnswerRe: Lock a file / Directory Pin
David Crow11-Aug-06 10:53
David Crow11-Aug-06 10:53 
GeneralRe: Lock a file / Directory [modified] Pin
sundar15611-Aug-06 11:02
sundar15611-Aug-06 11:02 
QuestionMoving AfxMessageBox() to a different location Pin
Reagan Conservative11-Aug-06 8:32
Reagan Conservative11-Aug-06 8:32 
AnswerRe: Moving AfxMessageBox() to a different location Pin
Wes Aday11-Aug-06 11:05
professionalWes Aday11-Aug-06 11:05 
GeneralRe: Moving AfxMessageBox() to a different location Pin
Reagan Conservative11-Aug-06 11:32
Reagan Conservative11-Aug-06 11:32 
AnswerRe: Moving AfxMessageBox() to a different location Pin
bob1697211-Aug-06 16:19
bob1697211-Aug-06 16:19 
GeneralRe: Moving AfxMessageBox() to a different location Pin
Reagan Conservative14-Aug-06 3:17
Reagan Conservative14-Aug-06 3:17 
AnswerRe: Moving AfxMessageBox() to a different location [modified] Pin
A_Fa11-Aug-06 23:45
A_Fa11-Aug-06 23:45 
JokeRe: Moving AfxMessageBox() to a different location Pin
ovidiucucu12-Aug-06 4:00
ovidiucucu12-Aug-06 4:00 
QuestionSimple Argument Passing Question... Pin
stretchcoder11-Aug-06 7:34
stretchcoder11-Aug-06 7:34 
AnswerRe: Simple Argument Passing Question... Pin
Chris Losinger11-Aug-06 7:42
professionalChris Losinger11-Aug-06 7:42 
AnswerRe: Simple Argument Passing Question... Pin
David Crow11-Aug-06 7:43
David Crow11-Aug-06 7:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.