CloseHandle
-
Hi all. Im having trouble finding a simple example of CloseHandle. Does anyone know of a place where i can see a simple code using this function? Thanx in advance!
-
Hi all. Im having trouble finding a simple example of CloseHandle. Does anyone know of a place where i can see a simple code using this function? Thanx in advance!
Please refer http://msdn2.microsoft.com/en-us/library/ms724211.aspx[^]. For example,
HANDLE hFile; hFile = CreateFile( lpFileName, // file name dwDesiredAccess, // access mode dwShareMode, // share mode lpSecurityAttributes, // SD dwCreationDisposition, // how to create dwFlagsAndAttributes, // file attributes hTemplateFile // handle to template file ); ::CloseHandle(m_hFile);
-
Hi all. Im having trouble finding a simple example of CloseHandle. Does anyone know of a place where i can see a simple code using this function? Thanx in advance!
How could you have difficulty ? Did you try google, MSDN, etc ? Here is a very basic example:
HANDLE myHandle = CreateMutex(); // Or whatever call you want here
...
if(!CloseHandle(myHandle))
{
// Handle error, you should always check return value of CloseHandle()
}regards,
Jonathan Wilkes Darka[Xanya.net]