November 17th, 2008, 09:56 AM
BeforeNavigate2 and PostData
Hi, I'm capturing the BeforeNavigate2 event of a web browser control. I want to change the PostData and resend the request (Navigate2). It gets resent, but the post data becomes empty. Here's the event:
If that's the wrong way, how would you advise to do it? Thanks
void BeforeNavigate2(IDispatch *pDisp, VARIANT * url,VARIANT * Flags,VARIANT * TargetFrameName, VARIANT * PostData,VARIANT * Headers, VARIANT_BOOL * Cancel)
static BOOL isReNavigate = 1;
if(isReNavigate == 1)
IWebBrowser2 *iweb = NULL;
*Cancel = VARIANT_TRUE;
isReNavigate = 0;
(pDisp, &IID_IWebBrowser2, (void**)&iweb);
(iweb, url, Flags, TargetFrameName, PostData, Headers); //the browser opens the url, but no postdata is sent, I've checked that there is suitable data in PostData and it works if I'm not resending (but I need to edit the PostData).
isReNavigate = 1;
Click Here to Expand Forum to Full Width
This a Codeguru.com survey!