掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
PlaySound を Windows Forms Application (.NET) で使用するには? (ID:64812)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
はじめまして。 Windows Forms Application (.NET) でアニメーションを作成してます。その中でドアが開閉した際、開閉音を付けたいのですが、それが出来なくて困ってます。 visual .net C++ 2003 のフレームワークには、音を再生するクラスはなく、windows のクラスを使用することで(PlaySound)出来る事、そして実際 Console Application (.NET) では再生できました。(.cpp file のみ作成、WinMM.Lib は Linker->Input->Additional Dependencies にて添付) しかし、Windows Forms Application (.NET)上だと、どこに #include <windows.h> と #using <mscorlib.dll> を宣言すれば良いのかが分かりません。(.cpp file なのか .h file なのか) おそらく、そのせいで、 Form1.h(21): error C2065: 'SND_FILENAME' : undeclared identifier Form1.h(21): error C3861: 'PlaySound': identifier not found, even with argument-dependent lookup のエラーが発生するのだと思っているのですが。 ちなみに今は、Form1.h の一番上に #include "stdafx.h" #include "Form1.h" #include <windows.h> #using <mscorlib.dll> using namespace mySomething; の順に宣言してます。 何かご存知でしたら、よろしくお願いします。
←解決時は質問者本人がここをチェックしてください。
更新する
戻る
掲示板システム
Copyright 2021 Takeshi Okamoto All Rights Reserved.