Jump to content
  • Advertisement


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


Question About HFile - Win32

This topic is 5575 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

According to the MSDN Library for Win32 Simple Data Type page, it says "HFile Handle to a file opened by OpenFile, not CreateFile." Now, I am using VS 6.0 and according to MSDN, OpenFile is obsolete and I should use CreateFile. I am confused now. So should I call OpenFile or CreateFile? Thank you in advance for your time.

Share this post

Link to post
Share on other sites
Call CreateFile(). It''ll return a HANDLE.

OpenFile() is from Windows 3.1, and it''s only retained for backwards compatibilty so that you can run ancient apps on new operating systems.

The comment for HFILE in the docs is merely indicating that the CreateFile() function doesn''t return a HFILE. It''s not suggesting that you shouldn''t use that function.

Simon O''Connor
Creative Asylum Ltd

Share this post

Link to post
Share on other sites
The OpenFile is only for compatibility with old 16-bit Windows, so the programs could be compiled with no changes. If writing new application, you should use CreateFile


[edited by - MrAndrew on June 19, 2003 2:45:55 PM]

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!