delphi windows 中API函数调用时参数类型不同怎么解决???(100分)

海马

Unregistered / Unconfirmed
GUEST, unregistred user!
请问各位:<br>&nbsp; &nbsp; &nbsp;我是新手,想用 WINDOWS API 关于声卡底层函数,但是WINDOWS 中的参数类型和DELPHI<br>不一样,请问<br><br><br>&nbsp;WINDOWS中: 1) HMMIO mmioOpen(LPSTR szFilename, LPMMIOINFO lpmmioinfo, DWORD dwOpenFlags); <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;2) FOURCC mmioFOURCC(CHAR ch0, CHAR ch1, CHAR ch2, CHAR ch3 ); <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;3) &nbsp;MMRESULT mmioDescend(HMMIO hmmio, LPMMCKINFO lpck, LPMMCKINFO lpckParent, UINT wFlags); <br><br>&nbsp;DELPHI 中应如何应用 &nbsp; 1) ?<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;2) ?<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;3) ?
 
请查找他们在Windows单元中的原始接口定义(find in file or find in files)
 
不会的, 一般 windows 所有的数据类型 delphi 几乎都有, <br>可能你的单元没有引用, 比如 mmSystem 是多媒体的, 等等
 
&lt;font color=red&gt;我猜的&lt;/font&gt;:<br><br>1)<br>&nbsp;1.文件名,当然是string,或者是pchar<br>&nbsp;2.估计是一个集合,试着定义一个 myipmmioinfo:lpmmioinfo;<br>&nbsp; &nbsp;然后键入"myipmmioinfo."小数点输入后可能会有提示<br>&nbsp;3.标志,应该是integer类型<br>2)<br>&nbsp;四个都是char类型<br>3)<br>&nbsp;1,2,3.猜不出来<br>&nbsp;4.integer类型<br>
 
mmioOpen 和 mmioDescend 在MMSYSTEM.pas有定义。<br>而mmioFOURCC用以下<br><br>&nbsp;function mmioFOURCC(ch1:char;ch2:char;ch3:char;ch4:char):DWORD;<br>begin<br>&nbsp; result:=DWORD(ch1) or DWORD(byte(ch2)) shl 8 or<br>&nbsp; &nbsp; DWORD(byte(ch3)) shl 16 or DWORD(byte(ch4)) shl 24;<br>end;<br>&nbsp;其实是占四个字节的DWORD<br>&nbsp;可直接用PWORD(Pchar('abcd'))^ //'abcd'是四个char<br>&nbsp;得到。<br>
 
多人接受答案了。
 
顶部