[fpc-pascal]MMSYSTEM problem...

Micha? Kamburelis michalis at camelot.homedns.org
Fri Jul 25 08:40:50 CEST 2003


L D Blake wrote:
> I've just discovered that the MMSYSTEM unit for Win32 is missing at least one
> of the function call prototypes...  MCIWndCreate(...) is just plain not there.
> 
> Anyone know where I can get a fixed copy?

There is no such "fixed copy" of MMSystem unit. MMSystem unit is a 
translation of mmsystem.h C header and functions MCIWnd* are in vfw.h 
(BTW, this is true for Delphi as well). So you need a different unit. As 
far as I know there is no such unit in FPC packeges.

Here are the complete instructions on how you can obtain the unit that 
you want:
Searching with google I found this archive
   http://www.torry.net/vcl/mmedia/video/vfw.zip
(linked from page http://www.torry.net/video.htm). It contains unit 
Vfw.pas and this is what you need. BUT this unit is for Delphi 2/3/4 and 
you have to modify it (a little) to compile this with FPC.

1) Remove two units from "uses" clause changing
     Messages,
     CommDlg,
to
     {$ifndef FPC}
     Messages,
     CommDlg,
     {$endif}
Those two units are not needed under FPC (their stuff is in Windows 
unit) and both of them are even not available under FPC 1.0.x. (I don't 
think CommDlg is available even in 1.1).

2) You need to add
   type POPENFILENAMEA = POPENFILENAME;
and take declarations of two functions (GetOpenFileNamePreviewW and 
GetSaveFileNamePreviewW) in interface (and their export-clauses in 
implementation) in similiar {$ifndef FPC} ... {$endif} brackets.

(it's not the most elegant way to do that, you should check is UNICODE 
symbol defined etc.; but doing as I said you will also get what you most 
probably want)

And that's all - you have a unit Vfw.pas that can be compiled with FPC 
1.0.10. Warning - I only compiled this unit under FPC 1.0.10, I did not 
tested it (basically, I know nothing about functions in this unit, I was 
simply able to adjust Delphi unit to FPC) ! So I don't guarentee it 
works as it should. But probably it does, it's just a simple export 
unit. And it containd MCIWnd* functions that you wanted.

Hope this helps,
-- 
Michalis Kamburelis
michalis at camelot.homedns.org
http://www.camelot.homedns.org/~michalis/ (in Polish)





More information about the fpc-pascal mailing list