Click here to Skip to main content
15,901,035 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralTooltip for CListBox contents Pin
Raghunandan S27-Aug-04 22:10
Raghunandan S27-Aug-04 22:10 
GeneralRe: Tooltip for CListBox contents Pin
Ivan Cachicatari28-Aug-04 19:06
Ivan Cachicatari28-Aug-04 19:06 
GeneralDetecting HTTP errors with HttpOpenRequest/HttpSendRequest Pin
Michael Dunn27-Aug-04 21:21
sitebuilderMichael Dunn27-Aug-04 21:21 
GeneralReading a bitmap to a 2D array Pin
davidgin12327-Aug-04 20:59
davidgin12327-Aug-04 20:59 
GeneralRe: Reading a bitmap to a 2D array Pin
Vaclav29-Aug-04 8:30
Vaclav29-Aug-04 8:30 
GeneralTable selection Pin
Member 52815527-Aug-04 20:39
Member 52815527-Aug-04 20:39 
Generalms flexgrid Pin
Mike Danberg27-Aug-04 17:13
Mike Danberg27-Aug-04 17:13 
GeneralReadFile and reading a single line of text Pin
Paolo Ponzano27-Aug-04 13:08
Paolo Ponzano27-Aug-04 13:08 
hello,
I'm porting some old code from C to Windows code, I'm in a little trouble, suppose I've got a text file, I need to copy single line of text into a listview,
before I did something like

<br />
FILE *fMMC=fopen(filename,"r");<br />
.<br />
.<br />
.<br />
while(!feof(fMMC))<br />
	{<br />
		while (fgets(buffer,BUFFER_SIZE,fMMC))<br />
		{ ....insert buffer into listview<br />
                }<br />
        }<br />
<br />
<br />


now porting to Windows code, I did someting as

 HANDLE fMMC=CreateFiles(..all_the_parameters)...<br />
<br />
while(true)<br />
{<br />
 DWORD br;<br />
   ReadFile(fMMC, buffer, 255, &BR, NULL))	 break;<br />
<br />
}<br />


my question is : in buffer, I can have multiple lines, since with fgets it takes a whole line and stop, with ReadFile I can have 2/3/4 lines depending of each lenght, how do I can retrieve from buffer only 1 line at time? is there a simple way? so that if buffer is composed of 3 lines, i get 3 item in listview

Thanks in advance
Paolo

p.s. if it's possible in some way to copy only a line as fgets does, it would be much more better, thanks again
GeneralRe: ReadFile and reading a single line of text Pin
darkbyte27-Aug-04 13:53
darkbyte27-Aug-04 13:53 
GeneralApplication event and messages "sniffer" Pin
27-Aug-04 12:16
suss27-Aug-04 12:16 
GeneralRe: Application event and messages &quot;sniffer&quot; Pin
darkbyte27-Aug-04 13:48
darkbyte27-Aug-04 13:48 
GeneralRe: Application event and messages &quot;sniffer&quot; Pin
Charlie Williams27-Aug-04 14:07
Charlie Williams27-Aug-04 14:07 
GeneralRe: Application event and messages &quot;sniffer&quot; Pin
LukeV27-Aug-04 18:28
LukeV27-Aug-04 18:28 
GeneralGetting Visual Studio .NET 2003 Add-Ins to work Pin
Franz Klein27-Aug-04 11:05
Franz Klein27-Aug-04 11:05 
GeneralRe: Getting Visual Studio .NET 2003 Add-Ins to work Pin
Kevin McFarlane28-Aug-04 0:07
Kevin McFarlane28-Aug-04 0:07 
GeneralRe: Getting Visual Studio .NET 2003 Add-Ins to work Pin
darkbyte28-Aug-04 4:07
darkbyte28-Aug-04 4:07 
GeneralMacro or another Way Pin
Grahamfff27-Aug-04 10:27
Grahamfff27-Aug-04 10:27 
GeneralRe: Macro or another Way Pin
David Crow27-Aug-04 10:40
David Crow27-Aug-04 10:40 
GeneralRe: Macro or another Way Pin
Grahamfff27-Aug-04 21:52
Grahamfff27-Aug-04 21:52 
GeneralRe: Macro or another Way Pin
David Crow28-Aug-04 17:24
David Crow28-Aug-04 17:24 
GeneralRe: Macro or another Way Pin
Grahamfff30-Aug-04 9:24
Grahamfff30-Aug-04 9:24 
GeneralRe: Macro or another Way Pin
Bob Stanneveld28-Aug-04 7:40
Bob Stanneveld28-Aug-04 7:40 
GeneralsaveFileDialog Pin
jet91527-Aug-04 10:04
jet91527-Aug-04 10:04 
GeneralRe: saveFileDialog Pin
Maximilien27-Aug-04 10:14
Maximilien27-Aug-04 10:14 
GeneralRe: saveFileDialog Pin
toxcct28-Aug-04 7:58
toxcct28-Aug-04 7:58 

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.