![]() |
Home |
|
Win32 File HandlesOne important concept of the Win32 API are handles. The number of available Win32 handles is limited but can be changed (please refer to the RTTarget-32 Programming Manual, section Win32 Handles for details). It is very important that all handles are closed when no longer needed to avoid errors caused by an out-of-handle situation. Win32 handles (type HANDLE) must not be confused with RTFiles-32's file handles (type RTFHANDLE or int). Win32 handles reference objects indirectly, while RTFiles-32 handles reference them directly. Consequently, Win32 handles can be duplicated with function DuplicateHandle; the associated file is closed only after all handles have been closed. In contrast, RTFiles-32 file handles cannot be duplicated; they can only be copied, which does not create a new handle. Any call to RTFClose will immediately close the file.
|