I am using a third party tool that is pointing to images in memory with a windows handle.
The tool stats that you are responsible for freeing handle. So how would you free that handle in Delphi 7? The datatype for the handle is LONG
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If the tool tells you that you’re responsible for cleaning up, then it should have also told you what you should use. Take a closer look at the documentation.
You need to be more specific about what kind of handle you have. There’s no one function that frees all kinds of handles.
Most kernel objects (mutex objects, threads, processes, files, pipes, events, etc.) use
CloseHandle.If you really have an image handle, like
HBitmaporHIcon, then you free withDeleteObject.Window handles (
HWND) are released withDestroyWindow.You might have a memory handle, as returned by
GlobalAlloc; useGlobalFreefor that.It might not be a Windows handle at all. It might be a handle specific to your tool’s API that requires an API-specific function to destroy it.
The bottom line is that you need to know what you have.