Click here to Skip to main content
15,897,891 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: MSDN 2003 Pin
Ryan Binns20-Jul-03 15:48
Ryan Binns20-Jul-03 15:48 
GeneralRe: MSDN 2003 Pin
Toni7820-Jul-03 16:04
Toni7820-Jul-03 16:04 
GeneralRe: MSDN 2003 Pin
Ryan Binns20-Jul-03 16:31
Ryan Binns20-Jul-03 16:31 
GeneralRe: MSDN 2003 Pin
Atlantys20-Jul-03 16:57
Atlantys20-Jul-03 16:57 
GeneralRe: MSDN 2003 Pin
J. Dunlap20-Jul-03 20:08
J. Dunlap20-Jul-03 20:08 
GeneralControl Panel applet Pin
TSimoes20-Jul-03 11:35
TSimoes20-Jul-03 11:35 
GeneralTCP/IP Question Pin
arunkk20-Jul-03 11:32
arunkk20-Jul-03 11:32 
GeneralRe: TCP/IP Question Pin
Ilushka20-Jul-03 20:49
Ilushka20-Jul-03 20:49 
Thats simple. Smile | :)

Send expects a [long constant pointer to TCHAR] variable, so just putting somthing of type byte isn`t right. still, the second parameter of .Send is
a length of data to be sent, thats it in TCHARs.

So make it that way:

Suppose you have a

BYTE g_aBytes[1024];

filled with some interesting bytes and you want to send 651 of them.

just make a call like that:

iSent = m_sConnectSocket.Send((LPCTSTR) g_aBytes, 651);

here you do s old-style C cast from array of bytes to LPCTSTR. Also you expicitly tell the socket how much data you`d like to send. That`ll do the trick, unless you dont use UNICODE. Smile | :)

In general , from your post i see you`re not much expirienced in C++ programming. I recommend some serious reading - for example Bjane Stroustroup
C++ programming language third edition.

Be good,


Sincerely yours, Ilya Kalujny.
GeneralFindFiles Pin
pranavamhari20-Jul-03 9:27
pranavamhari20-Jul-03 9:27 
GeneralRe: FindFiles Pin
John R. Shaw20-Jul-03 11:37
John R. Shaw20-Jul-03 11:37 
QuestionFree graphing library? Pin
Nathan Evans20-Jul-03 7:43
Nathan Evans20-Jul-03 7:43 
AnswerRe: Free graphing library? Pin
John R. Shaw20-Jul-03 11:40
John R. Shaw20-Jul-03 11:40 
GeneralIStream from CComVariant (Help!!!) Pin
yitzhak20-Jul-03 5:38
yitzhak20-Jul-03 5:38 
GeneralUsing vectors Pin
gweather20-Jul-03 3:56
gweather20-Jul-03 3:56 
GeneralRe: Using vectors Pin
Dudi Avramov20-Jul-03 4:35
Dudi Avramov20-Jul-03 4:35 
GeneralRe: Using vectors Pin
gweather20-Jul-03 20:19
gweather20-Jul-03 20:19 
GeneralRe: Using vectors Pin
Dudi Avramov20-Jul-03 20:45
Dudi Avramov20-Jul-03 20:45 
GeneralSetRedraw in OnDraw(CDC *pDC) Pin
Majid Shahabfar20-Jul-03 2:54
Majid Shahabfar20-Jul-03 2:54 
GeneralRe: SetRedraw in OnDraw(CDC *pDC) Pin
Ryan Binns20-Jul-03 4:54
Ryan Binns20-Jul-03 4:54 
GeneralRe: SetRedraw in OnDraw(CDC *pDC) Pin
John M. Drescher21-Jul-03 3:26
John M. Drescher21-Jul-03 3:26 
QuestionHow to read data from serial port. Pin
George220-Jul-03 2:33
George220-Jul-03 2:33 
AnswerRe: How to read data from serial port. Pin
John R. Shaw20-Jul-03 11:44
John R. Shaw20-Jul-03 11:44 
GeneralRe: How to read data from serial port. Pin
George220-Jul-03 18:02
George220-Jul-03 18:02 
Generallearning vc++ Pin
virtualspy20-Jul-03 0:50
virtualspy20-Jul-03 0:50 
GeneralRe: learning vc++ Pin
Paul Ingles20-Jul-03 1:09
Paul Ingles20-Jul-03 1:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.