FindResource
-
Okay, I'm trying to load the raw data of a resource of a custom type. I've named the type "JPG" and have created a resource with the ID "IDR_JPG1". The resource is located within the executable. The code that I've come up with is: char* pData = 0; HRSRC hRsrc; HGLOBAL hGlobal; DWORD dWord; hRsrc = FindResource( NULL, ?, RT_RCDATA ); dWord = GetLastError(); // Produces 1813 (ERROR_RESOURCE_TYPE_NOT_FOUND) hGlobal = LoadResource( NULL, hRsrc ); pData = (char*)LockResource( hGlobal ); I have no idea what I need to be putting in place of the question mark. The MSDN Library provides only unclear and essentially useless information. Also, I'm a little uneasy about locking up a resource and not releasing it. Do I need to release it? There is a FreeResource function but I'm told that it is depricated. I'd appreciate any info you could send my way.
-
Okay, I'm trying to load the raw data of a resource of a custom type. I've named the type "JPG" and have created a resource with the ID "IDR_JPG1". The resource is located within the executable. The code that I've come up with is: char* pData = 0; HRSRC hRsrc; HGLOBAL hGlobal; DWORD dWord; hRsrc = FindResource( NULL, ?, RT_RCDATA ); dWord = GetLastError(); // Produces 1813 (ERROR_RESOURCE_TYPE_NOT_FOUND) hGlobal = LoadResource( NULL, hRsrc ); pData = (char*)LockResource( hGlobal ); I have no idea what I need to be putting in place of the question mark. The MSDN Library provides only unclear and essentially useless information. Also, I'm a little uneasy about locking up a resource and not releasing it. Do I need to release it? There is a FreeResource function but I'm told that it is depricated. I'd appreciate any info you could send my way.