Click here to Skip to main content
15,918,049 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralCListCtrl Report-style subitem image problem Pin
IGx8927-Sep-02 15:55
IGx8927-Sep-02 15:55 
GeneralRe: CListCtrl Report-style subitem image problem Pin
Roman Fadeyev28-Sep-02 1:17
Roman Fadeyev28-Sep-02 1:17 
GeneralRe: CListCtrl Report-style subitem image problem Pin
Michael Dunn28-Sep-02 5:40
sitebuilderMichael Dunn28-Sep-02 5:40 
GeneralRe: CListCtrl Report-style subitem image problem Pin
IGx8929-Sep-02 7:41
IGx8929-Sep-02 7:41 
QuestionHow to free Ram:Thank you for kindness Pin
buglight27-Sep-02 15:35
buglight27-Sep-02 15:35 
AnswerRe: How to free Ram:Thank you for kindness Pin
l a u r e n27-Sep-02 16:07
l a u r e n27-Sep-02 16:07 
GeneralRe: How to free Ram:Thank you for kindness Pin
Anonymous27-Sep-02 16:30
Anonymous27-Sep-02 16:30 
GeneralCFile & Buffer Reading::::Help would be very much appreciated Pin
merc27-Sep-02 14:42
merc27-Sep-02 14:42 
Hi Guys,

I asked this before and didn't get any favourable answers, and I'm still struggling with this:

Issue:
When I read a BINARY file, and writing to back, I get an ASSERT
ASSERT(lpBuf != NULL);
because my binary files contain spaces and null. And when I write it back, the program treats the buffer as NULL so it throws the ASSERT.

********However, it works for text files.*******
Is there anything I'm missing? After couple of loops of the binary read operation, buf is.... buf=""; but the bytes read still the right amount. Any help will be really appreciated.
Do these kind of things happen to everyone or just me?
CClient::Read(BYTE *buf, int iSize){
CFile pFile (sFilename, CFile::modeRead|typeBinary);
while(true){
iReadSize = pFile.Read(pBuf, 4045);
if(iReadSize == 0)
break;
}
}
//this is in an async. callback fn..the event will call it up

CServer::Write(BYTE *buf, int iSize)
{
CFile pFile (sFilename, CFile::modeWrite|typeBinary);
pFile.Write(buf, iSize);
}


My ass is on fire and my brain's on smoke.
JJ
GeneralRe: CFile & Buffer Reading::::Help would be very much appreciated Pin
RedZenBird27-Sep-02 16:14
RedZenBird27-Sep-02 16:14 
GeneralRe: CFile & Buffer Reading::::Help would be very much appreciated Pin
merc27-Sep-02 17:41
merc27-Sep-02 17:41 
GeneralRe: CFile & Buffer Reading::::Help would be very much appreciated Pin
RedZenBird27-Sep-02 19:42
RedZenBird27-Sep-02 19:42 
GeneralRe: CFile & Buffer Reading::::Help would be very much appreciated Pin
merc28-Sep-02 6:56
merc28-Sep-02 6:56 
Questionmay i read the same object on network from a file? Pin
imran_rafique27-Sep-02 14:31
imran_rafique27-Sep-02 14:31 
AnswerRe: may i read the same object on network from a file? Pin
merc27-Sep-02 17:45
merc27-Sep-02 17:45 
GeneralMouse Cursor Pin
Thanh Pham27-Sep-02 12:24
Thanh Pham27-Sep-02 12:24 
GeneralRe: Mouse Cursor Pin
RedZenBird27-Sep-02 12:53
RedZenBird27-Sep-02 12:53 
GeneralRe: Mouse Cursor Pin
TyMatthews27-Sep-02 13:42
TyMatthews27-Sep-02 13:42 
GeneralRe: Mouse Cursor Pin
Mike Nordell28-Sep-02 13:52
Mike Nordell28-Sep-02 13:52 
GeneralURLDownload to file (secure) Pin
DarrollWalsh27-Sep-02 11:46
DarrollWalsh27-Sep-02 11:46 
GeneralRe: URLDownload to file (secure) Pin
Axter27-Sep-02 16:26
professionalAxter27-Sep-02 16:26 
GeneralThread Parameter, delete, and ClassDestructor :: MFC Pin
valikac27-Sep-02 11:10
valikac27-Sep-02 11:10 
GeneralRe: Thread Parameter, delete, and ClassDestructor :: MFC Pin
Neville Franks27-Sep-02 11:51
Neville Franks27-Sep-02 11:51 
GeneralRe: Thread Parameter, delete, and ClassDestructor :: MFC Pin
valikac27-Sep-02 12:18
valikac27-Sep-02 12:18 
GeneralRe: Thread Parameter, delete, and ClassDestructor :: MFC Pin
RedZenBird27-Sep-02 12:47
RedZenBird27-Sep-02 12:47 
GeneralRe: Thread Parameter, delete, and ClassDestructor :: MFC Pin
valikac27-Sep-02 14:38
valikac27-Sep-02 14:38 

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.