Discussion Locked

Opening a File for reading

0 helpful
4 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I am tring to open a text file for read access. I am using Create file(code below).
I even tried to use OpenFile.
(assembly)
Win95 db "Win95.txt",0
invoke CreateFile, offset Win95, GENERIC_READ, 0, NULL, OPEN_EXISTING, NULL, NULL

4 replies

by sam hobbs

The following is taken directly from my C++ program:

HANDLE hascii = CreateFile("DiskFull.plg", GENERIC_READ,0,NULL,
OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);
DWORD FileSize = GetFileSize(hascii, NULL);
char *pBuffer = new char[FileSize];
ReadFile(hascii, pBuffer, FileSize, &FileSize, NULL);
delete [] pBuffer;

This discussion is closed to new replies.