none
请教WM上sockapp例子用GUID_NULL的问题 RRS feed

  • 问题

  • 我在WM上用SOCKAPP时出错:
    :\Program Files\Microsoft Visual Studio 8\VC\ce\atlmfc\include\atlcomcli.h(365) : error C2065: 'GUID_NULL' : undeclared identifier

    \SocClient.cpp(72) : error C2065: 'CLSID_RAPI' : undeclared identifier
    .\SocClient.cpp(73) : error C2065: 'IID_IRAPIDesktop' : undeclared identifier
    .\SocClient.cpp(82) : error C2027: use of undefined type 'IRAPIDesktop'
            C:\Program Files\Windows Mobile 6 SDK\Activesync\inc\rapi2.h(74) : see declaration of 'IRAPIDesktop'
    .\SocClient.cpp(82) : error C2227: left of '->EnumDevices' must point to class/struct/union/generic type
    .\SocClient.cpp(90) : error C2027: use of undefined type 'IRAPIEnumDevices'
            C:\Program Files\Windows Mobile 6 SDK\Activesync\inc\rapi2.h(62) : see declaration of 'IRAPIEnumDevices'
    .\SocClient.cpp(90) : error C2227: left of '->Next' must point to class/struct/union/generic type
    .\SocClient.cpp(97) : error C2027: use of undefined type 'IRAPIDevice'
            C:\Program Files\Windows Mobile 6 SDK\Activesync\inc\rapi2.h(56) : see declaration of 'IRAPIDevice'
    .\SocClient.cpp(97) : error C2227: left of '->GetConnectionInfo' must point to class/struct/union/generic type
    .\SocClient.cpp(118) : error C2027: use of undefined type 'IRAPIDesktop'
            C:\Program Files\Windows Mobile 6 SDK\Activesync\inc\rapi2.h(74) : see declaration of 'IRAPIDesktop'
    .\SocClient.cpp(118) : error C2227: left of '->Release' must point to class/struct/union/generic type
    .\SocClient.cpp(123) : error C2027: use of undefined type 'IRAPIEnumDevices'
            C:\Program Files\Windows Mobile 6 SDK\Activesync\inc\rapi2.h(62) : see declaration of 'IRAPIEnumDevices'
    .\SocClient.cpp(123) : error C2227: left of '->Release' must point to class/struct/union/generic type
    .\SocClient.cpp(128) : error C2027: use of undefined type 'IRAPIDevice'
            C:\Program Files\Windows Mobile 6 SDK\Activesync\inc\rapi2.h(56) : see declaration of 'IRAPIDevice'
    .\SocClient.cpp(128) : error C2227: left of '->Release' must point to class/struct/union/generic type

    搜索了一下rapi2.h文件(位于C:\Program Files\Windows Mobile 6 SDK\Activesync\inc)
    发现里面所有的定义都在:
    #ifndef UNDER_CE
    #endif
    中间,而UNDER_CE是WINCE程序中必须有的,如果去掉,就会有很多错误出来,不知道有没有人遇到过这种情况? 谢谢。
    2009年10月10日 2:11

答案

  • 你好,

    使用这个例子的时候,需要设置包含的库和头文件,即:

    \Program Files\Windows Mobile 6 SDK\Activesync\Lib
    \Program Files\Windows Mobile 6 SDK\Activesync\inc

    具体需要阅读该例子的readme.txt:\Common\CPP\Win32\SockApp\readme.txt


    施炯
    2011年3月30日 6:44
    版主