如何在BCB中调用sndplaysound??(50分)

  • 主题发起人 霁天寒
  • 开始时间

霁天寒

Unregistered / Unconfirmed
GUEST, unregistred user!
因为BCB的资料少,所以从DELPHI的资料上查的。呵呵~
不知道怎么调用API函数sndplaysound。在DELPHI中是“use mmsystem”,这样的,我在BCB中使用
#include "mmsystem.h"
包含头文件还是不能调用该API函数,错误提示为:函数未定义。
请教各位老大怎么解决,谢谢了!
 
老大,我这么做一点问题都没有呀?
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
#include "mmsystem.h"//<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
sndPlaySound("c://abc.wav",SND_LOOP);
}
//---------------------------------------------------------------------------
 
#include <mmsystem.h>
确实没问题!
 
sndPlaySound
你是不是没有区分大小写?
C是要区分大小写的。
从DELPHI到C很容易犯这种错误。
幸好我是先C后Delphi :)
 
呵呵~~~是大小写的关系,写了,各位!
 
顶部