我是一个VC++新手,想做一个系统服务程序。写了一段程序编译的时候说:
error C3861: 'AtlHresultFromLastError': identifier not found
头文件也都加了,像#include "stdafx.h"
#include "resource.h"
#include "AtlShowJiSvc_i.h"
#include <stdio.h>
为啥 hr = AtlHresultFromLastError();这句话会报这样的错呢?实在不解,望各位老大救我

解决方案 »

  1.   

    你是Visual Studio 2005版本吗
      

  2.   

    #include <atlcomcli.h>
    ??
      

  3.   

    #include <atlcomcli.h>
    这个也试了,不行啊真怪。。
      

  4.   

    这样写,就对了
    ATL::AtlHresultFromLastError();
      

  5.   

    你可用另一个宏HRESULTFROMWIN32Error
      

  6.   

    AtlHresultFromLastError calls GetLastError to obtain the last error and returns the error after converting it to an HRESULT using the HRESULT_FROM_WIN32 macro.