Click here to Skip to main content
12,445,274 members (55,241 online)

C / C++ / MFC

 
GeneralRe: Stop removal of null characters Pin
Tom Wright25-Aug-04 10:26
memberTom Wright25-Aug-04 10:26 
GeneralRe: Stop removal of null characters Pin
Rick York25-Aug-04 10:41
memberRick York25-Aug-04 10:41 
GeneralRe: Stop removal of null characters Pin
Tom Wright25-Aug-04 11:20
memberTom Wright25-Aug-04 11:20 
GeneralRe: Stop removal of null characters Pin
DavidCrow25-Aug-04 10:43
memberDavidCrow25-Aug-04 10:43 
GeneralRe: Stop removal of null characters Pin
Tom Wright25-Aug-04 11:21
memberTom Wright25-Aug-04 11:21 
GeneralRe: Stop removal of null characters Pin
DavidCrow25-Aug-04 11:27
memberDavidCrow25-Aug-04 11:27 
GeneralRe: Stop removal of null characters Pin
Tom Wright25-Aug-04 11:48
memberTom Wright25-Aug-04 11:48 
GeneralRe: Stop removal of null characters Pin
Michael Dunn25-Aug-04 10:52
sitebuilderMichael Dunn25-Aug-04 10:52 
GeneralRe: Stop removal of null characters Pin
Tom Wright25-Aug-04 11:23
memberTom Wright25-Aug-04 11:23 
GeneralRe: Stop removal of null characters Pin
Michael Dunn25-Aug-04 12:02
sitebuilderMichael Dunn25-Aug-04 12:02 
GeneralRe: Stop removal of null characters Pin
Tom Wright26-Aug-04 6:14
memberTom Wright26-Aug-04 6:14 
GeneralRe: Stop removal of null characters Pin
Joaquín M López Muñoz25-Aug-04 12:45
memberJoaquín M López Muñoz25-Aug-04 12:45 
GeneralRe: Stop removal of null characters Pin
Tom Wright26-Aug-04 6:00
memberTom Wright26-Aug-04 6:00 
GeneralRe: Stop removal of null characters Pin
=[ Abin ]=26-Aug-04 1:21
member=[ Abin ]=26-Aug-04 1:21 
As far as I can think, the closest solution should be replacing those null's with some other characters those otherwise will never be used in your application, for example, if your sure you'll never use the character '#', then:
// how long is your header gonna be, then how many #'s here
#define THE_HEADER _T("###...##")

// To make your packet:
CString sPacket = CString(THE_HEADER) + _T("your real contents");
 
// Now send your packet
socket.Send((LPCVOID)(LPCTSTR)sPacket, sPacket.GetLength() * sizeof(TCHAR));
 
// And the receiver then replace the #'s with null's
TCHAR szReceived[1024] = _T("");
receiver.Receive((LPVOID)szReceived, 1023); // suppose 1023 is enough
for (int i = 0; szReceived[i]; i++)
{
    if (szReceived[i] == _T('#'))
        szReceived[i] = _T('\0');
}
 
// Now you get what you want

GeneralRe: Stop removal of null characters Pin
Bill Buklis26-Aug-04 8:05
memberBill Buklis26-Aug-04 8:05 
GeneralWow this is a mess Pin
palbano25-Aug-04 18:55
memberpalbano25-Aug-04 18:55 
GeneralRe: Wow this is a mess Pin
Tom Wright26-Aug-04 5:54
memberTom Wright26-Aug-04 5:54 
GeneralRe: Wow this is a mess Pin
palbano26-Aug-04 7:59
memberpalbano26-Aug-04 7:59 
GeneralWindow Position Pin
Anthony988725-Aug-04 8:54
memberAnthony988725-Aug-04 8:54 
GeneralRe: Window Position Pin
Maximilien25-Aug-04 9:00
memberMaximilien25-Aug-04 9:00 
GeneralRe: Window Position Pin
Anthony988725-Aug-04 9:07
memberAnthony988725-Aug-04 9:07 
QuestionSaving password to registry? Pin
mcguile25725-Aug-04 8:16
membermcguile25725-Aug-04 8:16 
AnswerRe: Saving password to registry? Pin
Antony M Kancidrowski25-Aug-04 9:48
memberAntony M Kancidrowski25-Aug-04 9:48 
AnswerRe: Saving password to registry? Pin
DavidCrow25-Aug-04 10:19
memberDavidCrow25-Aug-04 10:19 
GeneralRe: Saving password to registry? Pin
darkbyte25-Aug-04 10:36
memberdarkbyte25-Aug-04 10:36 
GeneralRe: Saving password to registry? Pin
DavidCrow25-Aug-04 10:52
memberDavidCrow25-Aug-04 10:52 
GeneralRe: Saving password to registry? Pin
darkbyte26-Aug-04 5:00
memberdarkbyte26-Aug-04 5:00 
AnswerRe: Saving password to registry? Pin
cmk25-Aug-04 13:22
membercmk25-Aug-04 13:22 
AnswerRe: Saving password to registry? Pin
l a u r e n25-Aug-04 15:45
memberl a u r e n25-Aug-04 15:45 
GeneralRe: Saving password to registry? Pin
ThatsAlok25-Aug-04 21:53
memberThatsAlok25-Aug-04 21:53 
GeneralRe: Saving password to registry? Pin
darkbyte26-Aug-04 4:46
memberdarkbyte26-Aug-04 4:46 
AnswerRe: Saving password to registry? Pin
JimmyRopes26-Aug-04 9:33
memberJimmyRopes26-Aug-04 9:33 
GeneralDesign question (working with ATL OLE DB classes).... Pin
inner25-Aug-04 7:32
memberinner25-Aug-04 7:32 
GeneralRe: Design question (working with ATL OLE DB classes).... Pin
Doug Mitchell25-Aug-04 8:44
memberDoug Mitchell25-Aug-04 8:44 
GeneralRe: Design question (working with ATL OLE DB classes).... Pin
inner25-Aug-04 15:55
memberinner25-Aug-04 15:55 
GeneralRe: Design question (working with ATL OLE DB classes).... Pin
Ryan Binns25-Aug-04 18:31
memberRyan Binns25-Aug-04 18:31 
GeneralRe: Design question (working with ATL OLE DB classes).... Pin
inner26-Aug-04 3:34
memberinner26-Aug-04 3:34 
GeneralRe: Design question (working with ATL OLE DB classes).... Pin
palbano25-Aug-04 19:50
memberpalbano25-Aug-04 19:50 
GeneralRe: Design question (working with ATL OLE DB classes).... Pin
inner26-Aug-04 3:45
memberinner26-Aug-04 3:45 
GeneralRe: Design question (working with ATL OLE DB classes).... Pin
palbano26-Aug-04 4:34
memberpalbano26-Aug-04 4:34 
GeneralWin32 console application - stop window from displaying Pin
bdiamond25-Aug-04 7:22
memberbdiamond25-Aug-04 7:22 
GeneralRe: Win32 console application - stop window from displaying Pin
Papa25-Aug-04 7:46
memberPapa25-Aug-04 7:46 
GeneralProblem using RichTextBox Pin
SuperTank25-Aug-04 6:09
memberSuperTank25-Aug-04 6:09 
GeneralRe: Problem using RichTextBox Pin
Tom Wright25-Aug-04 6:21
memberTom Wright25-Aug-04 6:21 
GeneralRe: Problem using RichTextBox Pin
bdiamond25-Aug-04 7:43
memberbdiamond25-Aug-04 7:43 
GeneralRe: Problem using RichTextBox Pin
DavidCrow25-Aug-04 10:21
memberDavidCrow25-Aug-04 10:21 
GeneralRe: Problem using RichTextBox Pin
SuperTank25-Aug-04 10:40
memberSuperTank25-Aug-04 10:40 
GeneralDeriving from a CStatic Pin
act_x25-Aug-04 6:01
memberact_x25-Aug-04 6:01 
GeneralRe: Deriving from a CStatic Pin
Michael P Butler25-Aug-04 6:28
memberMichael P Butler25-Aug-04 6:28 
GeneralRe: Deriving from a CStatic Pin
Maximilien25-Aug-04 6:33
memberMaximilien25-Aug-04 6:33 

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.


Advertise | Privacy | Mobile
Web02 | 2.8.160811.3 | Last Updated 23 Aug 2016
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid