Skip to main content
gamedev.net
🔒 Locked

DirectAudio wrapper problem

Started by Laroche 1 reply 150+ views
Original Post
Laroche
Laroche
I have a member functoin in my class wrapper called "LoadFile()" in order to wrap the loader->LoadObjectFromFile function. The problem is i''m not quite sure of the syntax nessecary. the declaration is:
  
int LoadFile(WCHAR Filename[MAX_PATH]);
  
And the function is implemented as:
  
CDAW::LoadFile(WCHAR filename[MAX_PATH])
{
	if (FAILED(Loader->LoadObjectFromFile(
        CLSID_DirectMusicSegment,
        IID_IDirectMusicSegment8,
        filename,               
        (LPVOID*)&Segment
    )))
	{
		MessageBox(NULL, "DA LoadFile() Failed", "damn", MB_OK);
	}
	return (TRUE);
}
  
but it doesn''t work...im not quite sure what to pass to the function in order to get it to work properly, any help would be greatly appreciated, thanks!
Check out my music at: http://zed.cbc.ca/go.ZeD?user_id=41947&user=Laroche&page=content
Laroche
Laroche
When I do that, I get the following error message:

error C2664: ''LoadFile'' : cannot convert parameter 1 from ''char [15]'' to ''unsigned short *''

Do i have to type cast Filename to an unsigned short pointer?
Check out my music at: http://zed.cbc.ca/go.ZeD?user_id=41947&user=Laroche&page=content

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.