DirectMusic Problem lazarus / 72-DirectX ---------------------------------------------------------------------- Aeternitas · 2013-10-11 10:22 Hi, I try to use DirectX music in my application, because I need to play SGT music files. I downloaded Clootie DirectX Headers and defined: Code: [Select]objDX8Loader: IDirectMusicLoader8;   objDX8Segment: IDirectMusicSegment8;   objDX8Performance: IDirectMusicPerformance8;   objDX8SegmentState: IDirectMusicSegmentState8; Then I tried to init audio and load the music file: Code: [Select]procedure TForm30.Load(FileNamePath: string); begin   CoInitialize(nil); //initialize COM   CoCreateInstance(CLSID_DirectMusicLoader,                  nil,                  CLSCTX_INPROC,                  IID_IDirectMusicLoader8,                  objDX8Loader); //create loader object   CoCreateInstance(CLSID_DirectMusicPerformance,                  nil,                  CLSCTX_INPROC,                  IID_IDirectMusicPerformance8,                  objDX8Performance); //create performance object   objDX8Performance.InitAudio(nil,nil,WindowHandle,DMUS_APATH_SHARED_S TEREOPLUSREVERB,32,DMUS_AUDIOF_ALL,nil); //initialize DirectMusic & DirectSound   CoCreateInstance(CLSID_DirectMusicSegment,nil,CLSCTX_INPROC,IID_IDir ectMusicSegment8,objDX8Segment);   objDX8Loader.LoadObjectFromFile(CLSID_DirectMusicSegment,IID_IDirect MusicSegment8,PWideChar(FileNamePath),objDX8Segment);   objDX8Segment.Download(objDX8Performance); end; The code has been successfully compiled and ran, but then unfortunately the application crashed by the line objDX8Performance.InitAudio referring External SIGSEGV exception. I use Win7 64bit, Lazarus 1.0.12 64bit. DirectX 9 is installed and I also put the DLLs from Clootie's page next to application exe file. Any idea what I do wrong? Thanks in advance. ---------------------------------------------------------------------- marcov · 2013-10-11 11:24 Are those DLLs and headers fit for 64-bit programs?  A 64-bits programs can use a 32-bit DLL. FPC 2.6.x 64-bit doesn't support certain forms of exception handling (in non FPC code). IF you have a problem with exceptions from external code in 64-bit mode, try the development version of FPC. ---------------------------------------------------------------------- Aeternitas · 2013-10-11 15:45 I have also 32 bit installation of Lazarus; causing the exception as well. Which version do you mean? Prerelease 1.1.99? If not, please give a link. ---------------------------------------------------------------------- BigChimp · 2013-10-11 16:51 Quote from: Aeternitas on October 11, 2013, 05:45:57 pmWhich version do you mean? Prerelease 1.1.99? If not, please give a link. 1.1.99 is still based on 2.6.x so no. You would need a snapshot based on FPC 2.7.1 or compile yourself using an svn copy (e.g. using fpcup). ---------------------------------------------------------------------- BlueIcaro · 2013-10-11 16:57 do you have all need dll into folder where is your exe? or in path? /BlueIcaro ---------------------------------------------------------------------- Aeternitas · 2013-10-11 17:18 Quote from: BlueIcaro on October 11, 2013, 06:57:17 pmdo you have all need dll into folder where is your exe? or in path? /BlueIcaro I have there d3dx9_33.dll and DXErr9ab.dll. And DirectX9.2 is installed.