Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


more DAudio problems

This topic is 5860 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I got rid of all the other problems by re-typing everything in (weird?) but now when i try to load a midi, i get an unhandled exception return code 0x000005 or something. Anyway the problem is in this line:
m_pSegment->SetParam(GUID_StandardMIDIFile, 0xFFFFFFFF,0,0,NULL); 
Is it normal to have this failed? Am i forgetting to do something silly? let me post the loading code..
// In my program in WINMAIN I have a pointer to a CMidiMusic

// object called "pDirectDraw"...


// Now here is the function

int CMidiMusic::LoadMidiFromFile(LPCSTR szMidi,BOOL bMidiFile)
	WCHAR wstrMidi[256];

	// If exists a segment before, then release it

	if (m_pSegment) 
    // Converts ANSI (8-bits) to the UNICODE (16-bit) string

	// Then load it into the segment

							 (LPVOID*) &m_pSegment);

    // In case it is a midi file mark it is a standard midi file

	if (bMidiFile)
		m_pSegment->SetParam(GUID_StandardMIDIFile, 0xFFFFFFFF,0,0,NULL);          
	// Finally, download band data to the performance  


	return (TRUE);
sorry it is long but I''m stuck, and it wont let me put directmusic in debug mode for some reason..

Share this post

Link to post
Share on other sites
If i remember right direct music will crash if you try to play a segment that couldn''t be loaded. You need to check for this... or get the filename right (path too).


Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!