none
1>c:\program files (x86)\windows kits\8.0\include\um\winnt.h(146): fatal error C1189: #error : "No Target Architecture" RRS feed

  • 问题

  • my source code shows as following:


    #include <stdio.h>
    #include <Winuser.h>
    #include <afxwin.h>


    using namespace std;

    int main()
    {
    CWnd *pwnd = FindWindow(NULL, _T("新建文本文档.txt"));

    if (pwnd->GetSafeHwnd())
    {
    pwnd->ShowWindow(SW_NORMAL);
            pwnd->SetForegroundWindow();
    keybd_event(VK_CONTROL, 0, 0, 0);
    keybd_event('S', 0, 0, 0);
    keybd_event(VK_CONTROL, 0, KEYEVENTF_KEYUP, 0);
    keybd_event('S', 0, KEYEVENTF_KEYUP, 0);
    }
    }

    my project runs base on the Visual Studio 2012,  and when I build the project, it give out the errer :1>c:\program files (x86)\windows kits\8.0\include\um\winnt.h(146): fatal error C1189: #error :  "No Target Architecture"

    click the errer, i get the information as following:


    #if defined(_AMD64_) || defined(_X86_)
    #define PROBE_ALIGNMENT( _s ) TYPE_ALIGNMENT( DWORD )
    #elif defined(_IA64_) || defined(_ARM_)
    #define PROBE_ALIGNMENT( _s ) (TYPE_ALIGNMENT( _s ) > TYPE_ALIGNMENT( DWORD ) ? \
                                  TYPE_ALIGNMENT( _s ) : TYPE_ALIGNMENT( DWORD ))
    #elif !defined(RC_INVOKED)
    #error "No Target Architecture"
    #endif

    #if defined(_WIN64)

    2013年5月22日 16:00

答案