Hi,
Iam using ReadDirectoryChangesW function in winAPI to know the access details of a file in a directory.the code is as follows...
HANDLE h,hDir;
ifstream myfile1;
ofstream myfile2;
char *buff="",temp[256]="";
int i,length;
Entry *head=NULL,*tail=NULL,*e=new Entry();
hDir=CreateFile((LPCSTR)"C:\\sample\\example.txt",GENERIC_READ,FILE_SHARE_READ,NULL,OPEN_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL);
h=FindFirstChangeNotification((LPCTSTR)"C:\\sample",FALSE,FILE_NOTIFY_CHANGE_LAST_WRITE);
BOOL b=ReadDirectoryChangesW(hDir,buff,1024,FALSE,FILE_NOTIFY_CHANGE_LAST_WRITE,NULL,NULL,NULL);
DWORD d=GetLastError();
but i got the error 998 memory access violation.plz forgive me if any mistakes while using this function. Iam new to this fiel.Can any one help me.
Thanks in advance.