Hi


I want to open file, but if this file is opened by other user, I'll open in read opnly

This is my code, but doens't work ..


HANDLE hdl ;


hdl = CreateFile ( FileName, GENERIC_READ | GENERIC_WRITE , FILE_SHARE_READ ,

NULL,OPEN_EXISTING ,FILE_ATTRIBUTE_NORMAL , NULL );


if ( hdl == INVALID_HANDLE_VALUE )

hdl = CreateFile ( FileName, GENERIC_READ ,0,NULL,OPEN_EXISTING,

FILE_ATTRIBUTE_NORMAL , NULL );


Thanks for Help