I have an application where I have wave files embedded as resources. The wave files are added as Custom Resources under the type "WAVE".
Now, I am trying to retrieve the embedded wave files using FindResource() and LoadResource().
Now here's the problem: I am able to find the bitmap resource using FindResource() but NOT the Wave resources. I am using RT_R开发者_Go百科CDATA as ResourceType. Here's the code snippet:
// Load the .EXE file that contains the dialog box you want to copy.
hExe = LoadLibrary(TEXT("C:\\ExternalResource.exe"));
if (hExe == NULL)
{
//ErrorHandler(TEXT("Could not load exe."));
return 0;
}
// Locate the Testsong200 resource in the .EXE file.
//hRes = FindResource(hExe, MAKEINTRESOURCE(104), RT_BITMAP);
hRes = FindResource(hExe, MAKEINTRESOURCE(105), RT_RCDATA);
if (hRes == NULL)
{
//ErrorHandler(TEXT("Could not locate dialog box."));
return 0;
}
The hRes returns NULL when I use RT_RCDATA.
Any pointers in the right direction will make my day :)
regards, andy.
P.S I tried to upload the screenshot but realised that I need to have 10 rep points to upload one :(
OK, Got it.
I need to use FindResource in the following way:
hRes = FindResource(hExe, MAKEINTRESOURCE(105), _T("WAVE"));
regards, andy
精彩评论