如何从标准的Windows窗体应用程序中调用winmm.dll中的函数? [英] How do I call a function in winmm.dll from inside a standard windows form application?

查看:165
本文介绍了如何从标准的Windows窗体应用程序中调用winmm.dll中的函数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个标准的Windows表单应用程序,编译为witb / clr:pure switches。我试图调用WinMM.dll中的函数。我相信正确的h文件是C:\Program Files(x86)\ Microsoft Visual Studio 8 \ SDK \v2.0 \ include \ MMSystem.h。 h文件确实存在,可以通过depends.exe打开。



基本程序编译好,直到我添加对调用DLL函数的支持。



我尝试过的事情:



I have a standard Windows Form Application compiled witb /clr:pure switches. I am trying to call functions inside WinMM.dll. I beleive that the proper h file is "C:\Program Files (x86)\Microsoft Visual Studio 8\SDK\v2.0\include\MMSystem.h". The h file does exist and can be opened by depends.exe.

The basic program compiles fine until I add support for calling DLL functions.

What I have tried:

I have googled, bing, and yahooed this question (and a score of simlar ones) 'till my eyes glazed over.
I have tried:
#include <mmsystem.h> ------------------- 88 errors

#include <mmsystem> fatal error C1083: Cannot open include file: 'MMSystem': No such file or directory	

#import <mmsystem> error C2812: #import is not supported with /clr:pure and /clr:safe	

#using <C:\Program Files (x86)\Microsoft Visual Studio 8\SDK\v2.0\include\MMSystem.h> error C1192: #using failed on 'C:\Program Files (x86)\Microsoft Visual Studio 8\SDK\v2.0\include\MMSystem.h'

推荐答案

当然:

我发布完这篇文章之后;经过三天的搜索,我偶然发现了答案。使用[DllImport(winmm.dll,...



很抱歉浪费空间并感谢codeproject即使对于我们这些有时只是我们这些人的人来说也是如此DUMB;}
Of Course:
As soon as I finished posting this article; after three days of searching, I stumbled upon the answer. Use [DllImport("winmm.dll",...

Sorry for wasting space and thanks to codeproject for just being there even for those of us who are sometimes just DUMB ;}


这篇关于如何从标准的Windows窗体应用程序中调用winmm.dll中的函数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆