HI all, Ive tried at add resources to my program, with some luck, I did add a tga, but it appeared upside down, anyhow, I'd like to add a .IT (music file), and have added it as a resource, and fron the resource.h file I can see that it is the following:
#define IDR_BINARY1 105
I then tried to use mikmod to load the resource using a func posted in another thread (refractor I think):
anyway it compiles... then just crashes... any ideas? or better ways to do it?
#define IDR_BINARY1 105
I then tried to use mikmod to load the resource using a func posted in another thread (refractor I think):
- Code:
//
// FUNCTION: moveGetRawResourcePointer()
//
// PURPOSE: Returns a pointer to a TGA file in the resource file.
//
// COMMENTS:
//
// Returns a pointer to a TGA file in the resource file. Note that the memory
// taken by the LoadResource function has to be freed by the calling function.
//
unsigned short * moveGetRawResourcePointer( LPCTSTR lpResourceName )
{
// Find the resource in this module.
HRSRC hRsrc = FindResource( GetModuleHandle(NULL), lpResourceName, TEXT("BINARY") );
if( hRsrc == NULL )
return NULL;
// Load the resource into memory and get a pointer to the memory location.
HGLOBAL hGlobal = LoadResource( GetModuleHandle(NULL), hRsrc );
if( hGlobal == NULL )
return NULL;
return (unsigned short *)hGlobal;
}
Player_Load(moveGetRawResourcePointer(MAKEINTRESOURCE(IDR_BINARY1)),8,0);
anyway it compiles... then just crashes... any ideas? or better ways to do it?