I'm capturing the BeforeNavigate2 event of a WebBrowser control and I tried to edit the PostData parameter from here, but it won't send my updated data (just sends the original PostData).
Code:
void BeforeNavigate2(IDispatch *pDisp, VARIANT * url,VARIANT * Flags,VARIANT * TargetFrameName,
VARIANT * PostData,VARIANT * Headers, VARIANT_BOOL * Cancel)
{
SAFEARRAY* psa = (SAFEARRAY*)SendMessage(msgForward, WM_USER+0xdead,
(WPARAM)0, (LPARAM)PostData->pvarVal->parray); //retrieves modified post data into psa
SafeArrayCopyData(psa, PostData->pvarVal->parray); //applies the modified data
}
I've made sure it all works in debugger, isn't this the place where modifications of PostData before request can be made?