Hi Actually I have created a toolbar for IE which will be changed after user loggs into our site and will be changed again after he logs out.These things I have done ,but the problem comes when it is session expiry.if the user does not do anything for 20 minutes in our site,then the session will expire and according to that the toolbar should also be changed again.How can I achieve that?My idea was to get the cookie value for that user when he logs in and firing a MySql query with the cookie value to our database each time when there is a page navigation or page refresh.If my query returns with no value,then it will mean that session has expired and according to that I will change the toolbar.I am retrieving the cookie value.But there are some problems: 1.I need to fire the query in DownloadBegin or DownloadComplete,but this is making IE very slow and IE is crashing.Moreover what I have dicovered is that,in IE6 if I dont do a page refresh or site navigation,simply if i just move the mouse over the page,then also the flow is coming to downloadbegin too many times,means that many times the query will be fired......oooops..that will be dangerous.where should I fire the query then?
rindam
Posts
-
how to change toolbar in session expiary -
How to detect page refresh in vc++Hi I have created a toolbar for IE in ATL,COM and WTL without using MFC.Now I want to get notification whenever the user changes the URL in the address bar or does a page refresh.I am using BeforeNavigate2 function which is working properly for any URL change,but not working for page reload or refresh.I need to get notified whenever there is a page refresh and whenever there is a navigation to different page.How to get it?
-
where is the mistake here?TCHAR buffer [16384]; DWORD bufferSize = sizeof(buffer)/sizeof(buffer[0]); BOOL bRes = InternetGetCookie(("http://www.codeproject.com"), NULL, (LPWSTR)buffer, &bufferSize); DWORD ret; if(bRes==FALSE) { ret = ::GetLastError(); CString str; str.Format(_T("%d"),ret); MessageBox(NULL,str,NULL,MB_OK); MessageBox(NULL,_T("no items1"),NULL,MB_OK); if (ret == ERROR_NO_MORE_ITEMS) MessageBox(NULL,_T("no items"),NULL,MB_OK); else if(ret == ERROR_INSUFFICIENT_BUFFER) MessageBox(NULL,_T("insufficient buffer"),NULL,MB_OK); else if(ret == ERROR_INVALID_PARAMETER) MessageBox(NULL,_T("invalid parameters"),NULL,MB_OK); } else { MessageBox(NULL,buffer,NULL,MB_OK); } This code is displaying garbage value for buffer.But I need the cookie value.what to do?
-
How to print the cookie valueLPCSTR name="usrauth"; //name of the cookie TCHAR buffer [16384]; DWORD bufferSize = sizeof(buffer)/sizeof(buffer[0]); BOOL bRes = InternetGetCookieA(("http://www.mirracle.com"), name, (LPSTR)buffer, &bufferSize); MessageBox(NULL,buffer,NULL,MB_OK); This above code I am using to get the cookie value.But messagebox is not displaying the cookie value,it is displaying some garbage value.How to get the cookie value here?what is the mistake here
-
InternetGetCookie returning false always,plz help me to read cookie value from VC++I have tried with the below code: TCHAR buffer [16384]; DWORD bufferSize = sizeof(buffer)/sizeof(buffer[0]); BOOL bRes = InternetGetCookieA(("http://www.mirracle.com"), name, (LPSTR)buffer, &bufferSize); this code is working fine .but I need to get the cookie value,How can I get it?
-
InternetGetCookie returning false always,plz help me to read cookie value from VC++here also this function is returning false.whats the problem?
-
InternetGetCookie returning false always,plz help me to read cookie value from VC++InternetGetCookie function is always returning false.I am giving u the code here,can u plz tell me where the mistake is? ------------------------------------------------------------------------------- char szURL[256]="http://www.mirracle.com"; LPWSTR lpszData = NULL; // buffer to hold the cookie data DWORD dwSize=255; // variable to get the buffer size needed LPCWSTR usrauth =NULL; BOOL result=InternetGetCookie(szURL,usrauth,lpszData,&dwSize); DWORD ret; if(result==FALSE) { ret = GetLastError(); if (ret == ERROR_NO_MORE_ITEMS) MessageBox(NULL,_T("no items"),NULL,MB_OK); else if(ret == ERROR_INSUFFICIENT_BUFFER) MessageBox(NULL,_T("insufficient buffer"),NULL,MB_OK); else if(ret == ERROR_INVALID_PARAMETER) MessageBox(NULL,_T("invalid parameters"),NULL,MB_OK); } else { MessageBox(NULL,lpszData,NULL,MB_OK); } The InternetGetCookie function is always returning false here and I am not being able to get the cookie value for this particular site.Plz help me.
-
How to read cookie for particular site from VC++Hi I want to read cookie value for a particular site from VC++.My project is an IE Toolbar which is using ATL,COM and not using MFC.I need to get the cookie value for a site.I have tried with internetGetCookie function,but everytime it is returning false.Can anybody plz help me with some sample code?
-
how to detect whether is a user is logged in or not from IE ToolbarHi I have developed an IE toolbar in ATL,COM,WTL and without using MFC.This toolbar is for a particular site.This is having a sign in button on clicking which user will be navigated to sign in page of our site.After signing in the toolbar will be changed,means it will be having some extra buttons on it.when the user will click logout,the toolbar will be back to its previous state.Means this is like yahoo toolbar.Upto this part I have made it perfect.I have done MySql database connectivity from my toolbar.Now the problem what I am facing is that: if any user logs in our site and then he dose not do anything in the site for 20 minutes his session expires,means nothing will work in the site after idle 20 minutes,the user needs to sign in again.Now in that moment also I need to change the toolbar(I need to get the the toolbar in signed out state).How can I do it?Can anybody plz help me with some sample code?
-
Adding bitmap images to toolbar buttons programmaticallyHi I am creating a toolbar for IE in ARL,COM and WTL.I want to add bitmap images to the toolbar buttons programmatically.previously I was adding the images on the toolbar buttons by hand drawing.But these images obviously do not look good.I want to add bitmap images to the buttons programmatically.Can anybody help me with code?Thanks in advance.
-
reading string from a file without mfc support in vc++Hi I am having a typical problem from last one day.I am being able to writ into a text file from my vc++ application,but I am not being able to read the file.actually I need to write something in the file and I need need to again read the file.here is y code which is working fine for writing to file: FILE *fp=NULL; fp=_wfopen(lstr,_T("w+"));//lstr is having the path to the file fwrite( strTitleCurrentDate, sizeof(TCHAR), strTitle.GetLength()/** sizeof( TCHAR )*/, fp ); fclose( fp ); this code is working fine but CString strTitle1; newBuffer=strTitle1.GetBuffer(strTitle1.GetLength()* sizeof( TCHAR )); LPTSTR lstr=strPath2.GetBuffer(strTitle.GetLength()* sizeof( TCHAR )); FILE *fp=NULL; fp=_wfopen(lstr,_T("a+")); while(!feof(fp)) fread( newBuffer, sizeof(char), 100/** sizeof( TCHAR )*/, fp ); fclose( fp ); This piece of code really meking me frustrated because the data in file I am being able to read which actually should be "15th june 2007" is coming as "15th june 2007SID",from where this SID is coming?One more thing is that after this code of file reading if I take any CString variable and try to display it in a message box,it is showing the value "15th june 2007SID" whereas it should show blank.I am getting crash also in my application may be due to this problem.Plz help me to solve this problem with code,because it will help me a lot.Plz help me as early as possible because the deadline is coming and I am being frustrated.I also have to read data in a text file line by line which is also not being possible for me.Plz help me with code.