Click here to Skip to main content
16,004,991 members
Home / Discussions / C#
   

C#

 
GeneralPopping Up Context Menu Pin
ronin177016-Dec-04 5:02
ronin177016-Dec-04 5:02 
GeneralRe: Popping Up Context Menu Pin
Skynyrd16-Dec-04 7:35
Skynyrd16-Dec-04 7:35 
GeneralI have a network application which requires a matrix Pin
Mohammed Aijaz Mohiuddin16-Dec-04 4:59
Mohammed Aijaz Mohiuddin16-Dec-04 4:59 
GeneralKnow what direction a control is being resized to Pin
Gangren16-Dec-04 4:10
Gangren16-Dec-04 4:10 
GeneralRe: Know what direction a control is being resized to Pin
Skynyrd16-Dec-04 7:53
Skynyrd16-Dec-04 7:53 
GeneralNameObjectCollectionBase problem Pin
esakal16-Dec-04 2:30
esakal16-Dec-04 2:30 
GeneralRe: NameObjectCollectionBase problem Pin
Gary Thom16-Dec-04 3:33
Gary Thom16-Dec-04 3:33 
QuestionBinaryWriter, NetworkStream, missing data? Pin
HudsonKane16-Dec-04 1:43
HudsonKane16-Dec-04 1:43 
I have a c# app that communicates with a c++ app. I am trying t send some data to the c++ app using a binarywriter...
// socket is a connected and working Socket
socketStream = new NetworkStream(socket);
socketWriter = new BinaryWriter(socketStream);
...
byte[] bytPrefix = new byte[2];
bytPrefix[0] = 0;
bytPrefix[1] = 0;
byte[] bytLength = System.BitConverter.GetBytes(textWriter.GetStringBuilder().Length);
byte[] bytMessage = System.Text.Encoding.ASCII.GetBytes(textWriter.GetStringBuilder().ToString());
byte[] bytSend = new byte[2+4+textWriter.GetStringBuilder().Length];
bytPrefix.CopyTo(bytSend,0);
bytLength.CopyTo(bytSend,2);
bytMessage.CopyTo(bytSend,6);
socketWriter.Write(bytMessage);
socketWriter.Flush();
...

The c++ app gets a message ok, but it is missing the first 6 bytes. (if I put a break before the Write() bytMessage[0]-[5] are correct
Am I doing something incorrectly?
it seems that any non-text data I put at the beginning of the message is not sent...does the binary writer filter what it sends?
Thank You

AnswerRe: BinaryWriter, NetworkStream, missing data? Pin
HudsonKane16-Dec-04 3:34
HudsonKane16-Dec-04 3:34 
GeneralCrystal Report Pin
sevan16-Dec-04 1:34
sevan16-Dec-04 1:34 
GeneralPrinting with System.Drawing.Printing.PrintDocument - Problem on different printers Pin
Bhavin Soni16-Dec-04 1:28
Bhavin Soni16-Dec-04 1:28 
GeneralTransparent images in a picturebox Pin
mvanschie16-Dec-04 0:36
mvanschie16-Dec-04 0:36 
GeneralSchedule-like interface graphics Pin
SolidRock16-Dec-04 0:02
SolidRock16-Dec-04 0:02 
GeneralRe: Schedule-like interface graphics Pin
Gangren16-Dec-04 1:53
Gangren16-Dec-04 1:53 
GeneralRe: Schedule-like interface graphics Pin
Anonymous24-Dec-04 1:50
Anonymous24-Dec-04 1:50 
GeneralRe: Schedule-like interface graphics Pin
Gangren24-Dec-04 2:45
Gangren24-Dec-04 2:45 
GeneralInserting Images into a Ms Access Database Pin
SeDoHo15-Dec-04 23:59
SeDoHo15-Dec-04 23:59 
GeneralRe: Inserting Images into a Ms Access Database Pin
Guinness4Strength16-Dec-04 8:49
Guinness4Strength16-Dec-04 8:49 
GeneralContext Sensitive help for Groupbox Pin
Renee Jiao15-Dec-04 23:24
Renee Jiao15-Dec-04 23:24 
GeneralControls on a Form Pin
Anonymous15-Dec-04 22:21
Anonymous15-Dec-04 22:21 
GeneralRe: Controls on a Form Pin
Gangren15-Dec-04 22:33
Gangren15-Dec-04 22:33 
Generaldata base Pin
Prasadepparla15-Dec-04 21:48
Prasadepparla15-Dec-04 21:48 
GeneralRe: data base Pin
SeMartens15-Dec-04 22:35
SeMartens15-Dec-04 22:35 
GeneralRe: data base Pin
Prasadepparla15-Dec-04 23:11
Prasadepparla15-Dec-04 23:11 
GeneralRe: data base Pin
Heath Stewart15-Dec-04 23:22
protectorHeath Stewart15-Dec-04 23:22 

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.