Click here to Skip to main content
15,898,538 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: A template question Pin
ThatsAlok25-Dec-04 16:25
ThatsAlok25-Dec-04 16:25 
GeneralToolbar (URGENT) Pin
24-Dec-04 0:29
suss24-Dec-04 0:29 
GeneralKeyboard Input - MFC Pin
sweep12324-Dec-04 0:27
sweep12324-Dec-04 0:27 
GeneralRe: Keyboard Input - MFC Pin
Abin24-Dec-04 15:09
Abin24-Dec-04 15:09 
GeneralRe: Keyboard Input - MFC Pin
Grahamfff25-Dec-04 22:50
Grahamfff25-Dec-04 22:50 
Generalhtmlhelp visual studio .net Pin
tiziacaia24-Dec-04 0:09
tiziacaia24-Dec-04 0:09 
GeneralRe: htmlhelp visual studio .net Pin
Alex Korchemniy24-Dec-04 10:08
Alex Korchemniy24-Dec-04 10:08 
GeneralRe: htmlhelp visual studio .net Pin
tiziacaia24-Dec-04 16:07
tiziacaia24-Dec-04 16:07 
GeneralRe: htmlhelp visual studio .net Pin
Anonymous24-Dec-04 19:30
Anonymous24-Dec-04 19:30 
QuestionHow to access Window Procedure of another processes window Pin
User 21559723-Dec-04 23:48
User 21559723-Dec-04 23:48 
QuestionWhy I can't run my app. on Win XP? Pin
ArielR23-Dec-04 23:36
ArielR23-Dec-04 23:36 
AnswerRe: Why I can't run my app. on Win XP? Pin
Aamir Butt23-Dec-04 23:39
Aamir Butt23-Dec-04 23:39 
GeneralRe: Why I can't run my app. on Win XP? Pin
ArielR23-Dec-04 23:45
ArielR23-Dec-04 23:45 
GeneralRe: Why I can't run my app. on Win XP? Pin
Steve S24-Dec-04 0:58
Steve S24-Dec-04 0:58 
GeneralRe: Why I can't run my app. on Win XP? Pin
ArielR28-Dec-04 2:25
ArielR28-Dec-04 2:25 
Generalfstream problem Pin
Imtiaz Murtaza23-Dec-04 23:01
Imtiaz Murtaza23-Dec-04 23:01 
Friends,
I am opening a file using std::fstream. The purpose is to read all the contents of file into a buffer and then close the file. Program uses this buffer later.

The problem is that i am not an expert of fstream. I am using a function Read(), to copy data from file to buffer. The problem is the allocation of buffer. Lets see what i am doing:

fstream file("somefile.txt");

char *pBuffer = CreateNewBuffer(100) // 100 is buffer size

while(!file.eof())
{
file.read(buffer,100);
// Blah Blah
}
I don't know the number of bytes actually present in the file and so i am creating the buffer of size 100.

Is there any way to find out that how many bytes are there in the file OR how many bytes left, so that there will only be one Read() call instead of loop??
And most important for me is that how may bytes are actually read into the buffer.

Imtiaz
GeneralRe: fstream problem Pin
Andrew Walker24-Dec-04 1:06
Andrew Walker24-Dec-04 1:06 
QuestionHow to display a Message when click on a Edit Box Scroll bar ? Pin
pubududilena23-Dec-04 22:17
pubududilena23-Dec-04 22:17 
AnswerRe: How to display a Message when click on a Edit Box Scroll bar ? Pin
Aamir Butt23-Dec-04 22:31
Aamir Butt23-Dec-04 22:31 
GeneralRe: How to display a Message when click on a Edit Box Scroll bar ? Pin
pubududilena23-Dec-04 22:40
pubududilena23-Dec-04 22:40 
Questioncan i make command buttons in vc++(like vb) Pin
siva_nkl3323-Dec-04 21:47
siva_nkl3323-Dec-04 21:47 
AnswerRe: can i make command buttons in vc++(like vb) Pin
ThatsAlok23-Dec-04 22:47
ThatsAlok23-Dec-04 22:47 
Generalabout breakpoints in VC++ Pin
grace_sonal23-Dec-04 21:05
grace_sonal23-Dec-04 21:05 
GeneralRe: about breakpoints in VC++ Pin
mirex25-Dec-04 7:35
mirex25-Dec-04 7:35 
GeneralTemplate class and header files Pin
Imtiaz Murtaza23-Dec-04 19:01
Imtiaz Murtaza23-Dec-04 19:01 

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.