I am developing an internet-explorer plug-in (Browser Helper Object-BHO) in C++. In that, when the event BeforeNavigate2 is fired I want to save the URL to a file.
Therefore, to open the file I wrote the usual code:
FILE* fp;
fp = fopen("E:\\visurl.txt", "a");
if (fp == NULL){
MessageBox(NULL, "fopen failed!", _T("BHO!!!"), MB_OK | MB_ICONINFORMATION);
}
else{
MessageBox(NULL, "fopen succeeded!", _T("BHO!!!"), MB_OK | MB_ICONINFORMATION);
//here I would append the url in the file poined by *fp
fclose(fp);
}
And every-time it displays the "fopen failed" message.
What could be the problem? Please help. I need it badly. Thank you.