Hello, im trying to compile my game on Vc++.Net, I have run into a problem tough. I am trying to load a wave file from a resource. I am using the dsutil.h wrapper that comes with the dxsdk to load wave files. This used to work with vc++ 6.0. But now it dosnt =(
I have traced it in the dsutil.cpp file to the FindResource() function, which is returning null when it shouldent.
dsutil.cpp:
// Loading it as a file failed, so try it as a resource
if( NULL == ( hResInfo = FindResource( NULL, strFileName, TEXT("WAVE") ) ) )
{
if( NULL == ( hResInfo = FindResource( NULL, strFileName, TEXT("WAV") ) ) )
return DXTRACE_ERR_NOMSGBOX( TEXT("FindResource"), E_FAIL );
}
I tried to add this line right above that when i was searching for the error, so there is no doubt that strFileName has the name of the resource in it:
if(strFileName == "music1")
MessageBox(NULL, "it''s there", "ERROR" ,MB_OK | MB_ICONEXCLAMATION);
music1 is the name of the resource. I dont think its anything wrong with my .rc file or resource.h. Because i can load images and icons just fine from them, and they are generated by msvc.net.
I have no clue why it fails, maybe FindResource dont work on windowsXP and msvc.net?