在2008年VisualStudio中使用MMSYSTEM.H [英] Using mmsystem.h in VisualStudio 2008

查看:640
本文介绍了在2008年VisualStudio中使用MMSYSTEM.H的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我想确实创造一个64位的DLL文件,设置全局钩子。当我读它不能使用CLR做(我甚至试过),所以我创建了一个Win32项目,我会建立它的64位平台。 它会以这种方式工作?

Hi
I'm trying do create a 64bit dll which sets a global hook. As I read it can't be done with CLR (I even tried), so I created a Win32 project and I will build it for 64bit platform. Will it work this way?

我的主要问题是如何利用MMSYSTEM.H在这个项目。我需要使用多媒体计时器,当我使用timeBeginPeriod或timeSetEvent我有一个链接错误:

My main question is how to use mmsystem.h in this project. I need to use multimedia timer and when I use timeBeginPeriod or timeSetEvent I have a linker error:

1> dll64.obj:错误LNK2019:​​解析外部符号_ 小鬼的_timeSetEvent @ 20函数引用_InstallHook1 @ 0
1> dll64.obj:错误LNK2019:​​解析外部符号_ 小鬼的_timeBeginPeriod @ 4在功能上引用_InstallHook1 @ 0

1>dll64.obj : error LNK2019: unresolved external symbol _imp_timeSetEvent@20 referenced in function _InstallHook1@0
1>dll64.obj : error LNK2019: unresolved external symbol _imp_timeBeginPeriod@4 referenced in function _InstallHook1@0

如何解决这一问题?

推荐答案

您有WINMM.LIB联系起来,这不是那个被链接默认库之一。一个简单的方法是将链接指令在源$ C ​​$ C:

You have to link with winmm.lib, it isn't one of the default libraries that gets linked. A simple way is to put the link instruction in your source code:

#include <windows.h>
#include <mmsystem.h>
#pragma comment(lib, "winmm.lib")

这篇关于在2008年VisualStudio中使用MMSYSTEM.H的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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