Question About HFile - Win32

Started by
2 comments, last by john_deimos 20 years, 10 months ago
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.
Its better to die in battle, than to die an old man.
Advertisement
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
www.creative-asylum.com

Simon O'Connor | Technical Director (Newcastle) Lockwood Publishing | LinkedIn | Personal site

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

SLLOWWW

[edited by - MrAndrew on June 19, 2003 2:45:55 PM]
Thanks guys for your quick (very quick) responses. It is much appreciative.
Its better to die in battle, than to die an old man.

This topic is closed to new replies.

Advertisement