当前位置:首页
开发技术指南» 文章正文
    引言:
 

 

    摘要: 在2k下我们拔下网线插头后系统会提示网络连接有问题,但如何用程序代码获取这个事件呢?望高手解答! ......
    摘要: 我是在程序中控制另一个程序中的按钮! 下面这句已经成功! hwnd hok = ::getdlgitem( hwnd , 0x00000001 ); if( hok != null ) { ::sendmessage( hok , wm_lbuttondown , null , null ); ::sendmessage( hok , wm_lbuttonup , nu......


很简单的错误,我就是搞不定它,用过raw socket的进来(40)

原来的贴子:  
  http://expert.csdn.net/Expert/topic/2005/2005138.xml?temp=.4845697  
   
  开始,一个头文件找不到,将#include   <mstcpip.h>   换成   #include   <Ws2tcpip.h>  
  然后将好多段代码重新敲了一面。  
  最终出现了如下这个错误:  
  D:\netcapture\netcapture.cpp(153)   :   error   C2065:   SIO_RCVALL   :   undeclared   identifier  
   
  对应的代码:  
  iErrorCode=WSAIoctl(SockRaw,SIO_RCVALL,&dwBufferInLen,sizeof(dwBufferInLen),  
  &dwBufferLen,sizeof(dwBufferLen),&dwBytesReturned,NULL,NULL);  
   
  我仔细看了SIO_RCVALL好几眼,还是看不出问题。  
  我也不知道这个联接的source是否真的调试通过,我确实也仔细读了  
  这个代码,帮忙look一下。  
 

NO.1   作者: longxiongqiu

你没装psdk,所以找不到<mstcpip.h>   ,你不能用<Ws2tcpip.h>替换<mstcpip.h>

NO.2   作者: kxyes

#include   <Mstcpip.h>  
  去微软网站下SDK也就是PSDK,  
  我刚下了完整的300多M,完全安装1。4G!!!

NO.3   作者: Onega

SIO_RCVALL大概是只有windows2000以上才支持,所以你要在stdafx.h中定义  
    In   order   to   access   Win2000   specific   APIs   etc,   one   needs   the   following   #define   in   the   applications   stdafx.h   (before   any   other   #includes)    
  #define   _WIN32_WINNT   0x0500

NO.4   作者: wangbobo

那里用到装那东西,不就是个宏?  
  自己写一下连include   <mstcpip.h>都不用了   给你mstcpip.h   源文件自己存成   mstcpip.h  
  再给你片文章  
  http://www.csdn.net/develop/article/13/13890.shtm  
   
  //*************************************************************************//  
  //*   Header   File:   mstcpip.h  
  //*************************************************************************//  
  //     Copyright   (c)   Microsoft   Corporation.   All   rights   reserved.  
  #if   _MSC_VER   >   1000  
  #pragma   once  
  #endif  
   
  /*   Argument   structure   for   SIO_KEEPALIVE_VALS   */  
   
  struct   tcp_keepalive   {  
          u_long     onoff;  
          u_long     keepalivetime;  
          u_long     keepaliveinterval;  
  };  
   
  //   New   WSAIoctl   Options  
   
  #define   SIO_RCVALL                         _WSAIOW(IOC_VENDOR,1)  
  #define   SIO_RCVALL_MCAST             _WSAIOW(IOC_VENDOR,2)  
  #define   SIO_RCVALL_IGMPMCAST     _WSAIOW(IOC_VENDOR,3)  
  #define   SIO_KEEPALIVE_VALS         _WSAIOW(IOC_VENDOR,4)  
  #define   SIO_ABSORB_RTRALERT       _WSAIOW(IOC_VENDOR,5)  
  #define   SIO_UCAST_IF                     _WSAIOW(IOC_VENDOR,6)  
  #define   SIO_LIMIT_BROADCASTS     _WSAIOW(IOC_VENDOR,7)  
  #define   SIO_INDEX_BIND                 _WSAIOW(IOC_VENDOR,8)  
  #define   SIO_INDEX_MCASTIF           _WSAIOW(IOC_VENDOR,9)  
  #define   SIO_INDEX_ADD_MCAST       _WSAIOW(IOC_VENDOR,10)  
  #define   SIO_INDEX_DEL_MCAST       _WSAIOW(IOC_VENDOR,11)  
   
  //   Values   for   use   with   SIO_RCVALL*   options  
  #define   RCVALL_OFF                           0  
  #define   RCVALL_ON                             1  
  #define   RCVALL_SOCKETLEVELONLY   2  
   
 


    摘要: 当在主页面上点击“附件”后,弹出页面,然后可以上传多个附件,上传完毕后,把结果返回到调用页面,最后把记录存入数据库!就像发邮件时带附件的那种情况!关健是如何把值返回来! ......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE