用sendto发送十六进制数组的问题,请教??
开始是这样的:CString strSend;
GetDlgItemText(IDC_EDIT_SEND,strSend);
sendto(m_socket,strSend,strSend.GetLength()+1,0,
(SOCKADDR*)&addrTo,sizeof(SOCKADDR));
我改为这样的,如下:
BYTE buffer[] = { 0x23, 0x1A, 0x00, 0x00, 0x00, 0xCC, 0xC4, 0x14, 0x00, 0x0A, 0x40, 0xC5, 0x00, 0xD9, 0xE4, 0x22, 0x33, 0x1F, 0x98, 0x7C};
sendto( SOCKET, buffer, sizeof(buffer), 0);
SetDlgItemText(IDC_EDIT_SEND,"");
编译出现如下错误????
Compiling...
ChatDlg.cpp
C:\Documents and Settings\Administrator\桌面\Chat\ChatDlg.cpp(254) : error C2275: 'SOCKET' : illegal use of this type as an expression
c:\program files\microsoft visual studio\vc98\include\winsock.h(35) : see declaration of 'SOCKET'
Error executing cl.exe.
ChatDlg.obj - 1 error(s), 0 warning(s)
请大侠指点,或有什么好方法呢??