Quantcast
Channel: Fortran
Viewing all articles
Browse latest Browse all 3108

CreateFile will not always open an excisting file

$
0
0

Hallo,

I use the function shown below to load textfiles to a buffer for later to show the text in a text box.

Usually it works fine, but in some cases the file can not be opened (handle hFile=0) and the no text is read. As a test I have tried

to open and the close the file  ( by the standard Open /Close  Fortran statements) before I apply the CreateFile function to ensure the file is

not locked somwhere else in the program.  Open/close is ok, but the CreateFile function do not always succed in opening it.

When I open the textfile with Notepad, it always looks OK.

Looking forward to get a clue from somebody out there....

Reidar

 

hFile = CreateFile(szFileName, GENERIC_READ, FILE_SHARE_READ, &

NULL, OPEN_EXISTING, 0, NULL)


Viewing all articles
Browse latest Browse all 3108

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>