The return type of LoadResource is HGLOBAL for backward compatibility, not because the function returns a handle to a global memory block. Do not pass this handle to the GlobalLock or GlobalFree function. To obtain a pointer to the resource data, call the \Program%20Files\Microsoft%20Visual%20Studio\MSDN\2001JUL\1033\winui.chm::/hh/winui/resource_4co5.htm" target="_blank">LockResource function.