Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


using ReadFile()

This topic is 5474 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Having trouble using ReadFile. Pretty sure it has to do with my pointer variable. Any help appreciated.

int main(void)
char filename[] = "text.txt";
long *pointer = NULL;
HANDLE file_handle;

     if ((file_handle = CreateFile(filename,
                              NULL)) == INVALID_HANDLE_VALUE)

    ReadFile(file_handle, pointer, 1, 0, NULL);
Assume text.txt has just one 8-bit character in the file. At the end of the code, pointer is always still NULL. By the way, I''ve tried just about every imaginable combination for the pointer variable type and no luck.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!