在程序中,使用RasDial拨号通过手机连接GPRS网络,
用RasHangUp断掉连接重新拨号连接时,出现668错误,如何解决?

解决方案 »

  1.   

    0x00000668在终端服务远程会话期间,只有管理员有添加、删除或配置服务器软件的权限。如果您要在服务器上安装或配置软件,请与网络管理员联系。The connection is terminated even if the RasDial call has not yet been completed.After this call, the hrasconn handle can no longer be used.An application should not call RasHangUp and then immediately exit. The connection state machine needs time to properly terminate. If the system prematurely terminates the state machine, the state machine can fail to properly close a port, leaving the port in an inconsistent state. Also, an immediate attempt to use the same connection may fail leaving the connection unusable. A simple way to avoid these problems is to call Sleep(3000) after returning from RasHangUp; after that pause, the application can exit. A more responsive way to avoid these problems is, after returning from RasHangUp, to call RasGetConnectStatus(hrasconn) and Sleep(0) in a loop until RasGetConnectStatus returns ERROR_INVALID_HANDLE.You can call RasHangUp on the handle returned by RasGetSubEntryHandle to terminate a single link in a multi-link connection. However, in this case, you cannot use RasGetConnectStatus to determine if the link terminated; RasGetConnectStatus may not return ERROR_INVALID_HANDLE even though the link terminated successfully.
    ///////////////
      

  2.   

    RasGetConnectStatus  用了这个还是报668错误啊,真怪了