Click here to Skip to main content
15,914,419 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Owner draw buttton:Unable to handle enter key event Pin
Hamid_RT15-Nov-06 18:36
Hamid_RT15-Nov-06 18:36 
GeneralRe: Owner draw buttton:Unable to handle enter key event Pin
Manish_Home15-Nov-06 19:17
Manish_Home15-Nov-06 19:17 
GeneralRe: Owner draw buttton:Unable to handle enter key event Pin
Hamid_RT15-Nov-06 20:07
Hamid_RT15-Nov-06 20:07 
GeneralRe: Owner draw buttton:Unable to handle enter key event Pin
Manish_Home15-Nov-06 20:30
Manish_Home15-Nov-06 20:30 
GeneralRe: Owner draw buttton:Unable to handle enter key event Pin
Hamid_RT15-Nov-06 21:00
Hamid_RT15-Nov-06 21:00 
GeneralRe: Owner draw buttton:Unable to handle enter key event Pin
Manish_Home14-Dec-06 22:10
Manish_Home14-Dec-06 22:10 
GeneralRe: Owner draw buttton:Unable to handle enter key event Pin
Hamid_RT14-Dec-06 22:30
Hamid_RT14-Dec-06 22:30 
QuestionReadFile() - Buffer... Pin
Programm3r15-Nov-06 1:48
Programm3r15-Nov-06 1:48 
Hi all,

I'm trying to get the data from a file and assigning each of the lines to a variable (array or something)

I have tried the following:
<br />
//file handle<br />
HANDLE hFile;<br />
//something to contain the number of bytes read<br />
DWORD dwNumRead;<br />
//a boolean test variable, to test for success of reads<br />
BOOL bTest;<br />
//a buffer… can actually be of any type<br />
char dwBuffer[256];<br />
<br />
// Opening an existing file for reading: <br />
hFile = CreateFile("client.cnf", GENERIC_READ, FILE_SHARE_READ,NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);<br />
// To read from the file: <br />
bTest= ReadFile(hFile, dwBuffer, sizeof(char)*256, &dwNumRead,NULL);<br />
printf("%s",dwBuffer);<br />


I receive data from the file (dwBuffer), but how can I assign each line to an variable (array element or something)

Lets say the file has the following data:
[SEND]
file1.txt
file2.txt

[RECEIVE]
file3.txt
file4.txt

Thanx in advance

The only programmers that are better than C programmers are those who code in 1's and 0's..... Smile | :)

Smile | :) Programm3r

AnswerRe: ReadFile() - Buffer... Pin
Monty215-Nov-06 2:02
Monty215-Nov-06 2:02 
GeneralRe: ReadFile() - Buffer... Pin
Programm3r15-Nov-06 2:06
Programm3r15-Nov-06 2:06 
GeneralRe: ReadFile() - Buffer... Pin
Monty215-Nov-06 2:10
Monty215-Nov-06 2:10 
GeneralRe: ReadFile() - Buffer... Pin
Programm3r15-Nov-06 2:17
Programm3r15-Nov-06 2:17 
GeneralOT Pin
Monty215-Nov-06 2:28
Monty215-Nov-06 2:28 
GeneralRe: OT Pin
Programm3r15-Nov-06 3:15
Programm3r15-Nov-06 3:15 
GeneralRe: OT Pin
Mark Salsbery15-Nov-06 11:17
Mark Salsbery15-Nov-06 11:17 
AnswerRe: ReadFile() - Buffer... Pin
prasad_som15-Nov-06 2:02
prasad_som15-Nov-06 2:02 
AnswerRe: ReadFile() - Buffer... Pin
toxcct15-Nov-06 2:09
toxcct15-Nov-06 2:09 
QuestionListbox problem Pin
priyank_ldce15-Nov-06 1:35
priyank_ldce15-Nov-06 1:35 
AnswerRe: Listbox problem Pin
prasad_som15-Nov-06 1:39
prasad_som15-Nov-06 1:39 
AnswerRe: Listbox problem Pin
Viorel.15-Nov-06 1:47
Viorel.15-Nov-06 1:47 
GeneralRe: Listbox problem Pin
priyank_ldce15-Nov-06 2:55
priyank_ldce15-Nov-06 2:55 
GeneralRe: Listbox problem Pin
Viorel.15-Nov-06 3:16
Viorel.15-Nov-06 3:16 
Questionmany loop Pin
Max++15-Nov-06 0:40
Max++15-Nov-06 0:40 
AnswerRe: many loop Pin
toxcct15-Nov-06 0:43
toxcct15-Nov-06 0:43 
AnswerRe: many loop Pin
Nibu babu thomas15-Nov-06 0:45
Nibu babu thomas15-Nov-06 0:45 

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.