是需要什么设置吗?

解决方案 »

  1.   

    你调用的什么API呀?可能需要另外加什么头文件吧。
      

  2.   

    头文件没加进来
    Compiler Error C2065
    'identifier' : undeclared identifierThe specified identifier was not declared.
    打个比方,如果你要调用mmioOpen函数,你在msdn中查mmioOpen,在那一面下面可以查到如下信息QuickInfo
      Windows NT: Requires version 3.1 or later.
      Windows: Requires Windows 95 or later.
      Windows CE: Unsupported.
      Header: Declared in mmsystem.h.
      Import Library: Use winmm.lib.
      Unicode: Implemented as Unicode and ANSI versions on Windows NT.那么,你就要包含mmsystem.h这个文件
    另外要在project->setting->link选项卡的object/library moudles中加上winmm.lib这样,你编译就可以过去了
      

  3.   

    去MSDN找一下相关的头文件包括上
      

  4.   

    是不是你用的API函数的相关的头文件没有包含进来呀!
    到MSDN中找到这个函数,然后看看他需要什么头文件,
    用#include 包含进来就可以了!
    祝你成功!
      

  5.   

    函数是GetWindowModuleFileName
    MSDN说Declasred in winuser.h,Include in windows.h
    但是我#include <windows.h>和#include <winuser.h>都没有用
      

  6.   

    HWND CLPhoneDlg::FindModuleMainWindow(HANDLE hModule)
    {
    HWND hWndDesktop=::GetDesktopWindow();
    HWND hFindWnd=NULL;
    char lpFileName[256]; do
    {
    hFindWnd = FindWindowEx( hWndDesktop,hFindWnd,NULL,NULL);//枚举桌面窗口
          //获取窗口对应的模块文件名

    if(GetWindowModuleFileName(hFindWnd,lpFileName,sizeof(lpFileName)))

    //得到模块句柄
    if(hModule =GetModuleHandle(lpFileName) )
    {
    return hFindWnd;
    }
    }
    }while(hFindWnd); return NULL;
    }