开发者

Using mmsystem.h in VisualStudio 2008

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?

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 : 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

How to fix this?


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")
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜