开发者

Problem with SetSuspendState

I write a small application to enter the computer to Standby Mode:

#include "stdafx.h"
#include <windows.h>
#include <PowrProf.h>

int _tmain(int argc, _TCHAR* argv[])
{
   SetSuspendState(FALSE, FALSE, FALSE);

   return 0;
}

I get this error: 1>Standby.obj : error LNK2001: unresolved external symbol _SetSuspendState@12 1>C:\Documents and Settings\Sobak\Desktop\Standby\Release\Standby.exe : fatal error LNK1120: 1 unresolved ext开发者_运维问答ernalsexternals

How can I fix it?

P.S. I use Visual Studio 2005

Thank you in advance.


You should link your programm with the PowrProf.lib library. You could do it by adding the following string:

#pragma comment(lib, "PowrProf.lib")
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜