For Programmers: Free Programming Magazines  


Home > Archive > MSDN > January 2005 > Unable to get the filehandle using CreatFile() function cal for write operation









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Unable to get the filehandle using CreatFile() function cal for write operation
Steven Livolsi

2005-01-05, 8:55 pm

Hello,

I'm using the "CreateFile" function call in order to write to an existing
file. It should give me a "filehandle".
However, the filehandle I get, is incorrect. Its 0xffffffff (-1).

I checked the permissions and they're OK(full control). I'm logged in as
the administrator.
I can read files, but I cannot write to an existing file.

fileHandle = CreateFile(fileName,
GENERIC_WRITE, // open for writing
0, // no share
NULL, // no security
OPEN_EXISTING, // existing file only
FILE_ATTRIBUTE_NORMAL, // normal file
NULL);

Thanks.


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com