c - Strange CreateFile behaviour -
c - Strange CreateFile behaviour -
strange createfile behaviour. tiring open file
handle hfile = createfile(l"e:\\temp\\1.txt", generic_read, file_share_write, null, open_always, file_attribute_normal, null); if (hfile == invalid_handle_value) { printf("could not createfile\n"); return; }
file opened no error (don't know target file).. reason in directory application running empty file "e"(wiout extention) created during createfile call. wrong here?
get rid of l
prefix of filename string. calling narrow version of createfile
(createfilea
) , passing in wide string.
alternatively, can set vs build app using unicode.
in either case, should utilize _t()
macro set appropriate string type. i.e.
handle hfile = createfile(_t("e:\\temp\\1.txt"),
c winapi
Comments
Post a Comment