getting a single line from a file

I was wondering if someone could tell me how to read a single line from a
text file.  I tried using getline, but my MFC program does not recognize the
getline function.  Nor does it recognize <string> or <string.h> or using
namespace std.   So is there another function that I can use in MFC?

    Roger


0
10/22/2003 5:35:58 PM
vc.mfc 33608 articles. 0 followers. Follow

2 Replies
663 Views

Similar Articles

[PageSpeed] 16

    Take a look at the CStdioFile MFC class.

-- 
Cheers
Check Abdoul [VC++ MVP]
-----------------------------------

"R.H." <roger.huggins@intermec.com> wrote in message
news:e98o6IMmDHA.1764@tk2msftngp13.phx.gbl...
> I was wondering if someone could tell me how to read a single line from a
> text file.  I tried using getline, but my MFC program does not recognize
the
> getline function.  Nor does it recognize <string> or <string.h> or using
> namespace std.   So is there another function that I can use in MFC?
>
>     Roger
>
>


0
CheckAbdoul
10/22/2003 5:36:32 PM
"R.H." <roger.huggins@intermec.com> wrote in message
news:e98o6IMmDHA.1764@tk2msftngp13.phx.gbl...
| I was wondering if someone could tell me how to read a single line from a
| text file.  I tried using getline, but my MFC program does not recognize the
| getline function.
| Nor does it recognize <string> or <string.h> or using
| namespace std.

Why not? what problem are you having? You dont need to use STL if all you are doing is
reading a text file. As pointed out, you can use CStdioFile::ReadString to accomplish it.
Regardless, STL works fine with MFC.

-- 
Ajay Kalra [MVP - VC++]
ajaykalra@yahoo.com

0
ajaykalra (6842)
10/22/2003 9:18:35 PM
Reply:

Similar Artilces:

Importing a Lotus file with a *.123 extension
My company uses Excel 97 and 2000 and we've received a Lotus file with a *.123 extension. Excel will not allow me to open it as it does not have the *.wk? format. I searched the web and while I found numerous people with the same problem I found no one who had the conversion answer. Any help would be greatly appreciated. Thanks Find someone with Lotus ver 9 or higher. Have them open the file, and save it as *.wk4 If you dont have Lotus available and want you can send it to me and I will do it for you Thanks "jim" <jimsto@gorbel.com> wrote in message news:088d01c35...

Navigation Bars
I put Navigation bars on my publisher website document. When I try to publish to a file or to the web, the Navigation Bars do not appear on the page(s). How do I resolve this?? Answer found in the web group. DavidF "Tom Snyder" <Tom Snyder@discussions.microsoft.com> wrote in message news:7A55B689-FE9D-4E1E-9B6C-3ED571156D46@microsoft.com... >I put Navigation bars on my publisher website document. When I try to >publish > to a file or to the web, the Navigation Bars do not appear on the page(s). > How do I resolve this?? Tony, did you get an answer to this...

Problem to open excel file
Hi to all, I have a problem with all excel file. The user can't open all excel file when she did a double click on it. She has this error message : "cannot find the file 'c:\documents and settings\desktop\......test.xls' (or one of its components). Make sure the path and filename are correct. And that all required libraries are available" Do you know what can I do to solve the issue?? regards Malcolm Your Excel file association may be lost. Start>Run "excel.exe /regserver"(no quotes and note the space before the / mark). You may have to en...

Get paid to post in forums..
myLot promises to pay as you talk on its discussion boards. You can post and reply to whatever topic that you like. to join: http://www.mylot.com/?ref=blogger1 The following is taken from their website: ****************************** How does this work? We have implemented a system to give everyone who uses the internet the ablity to make money. The idea is pretty simple - if you contribute to the myLot Community - whether it is by posting a new discussion, responding to a current discussion, commenting on a current discussion, or referring friends, you earn money. Our goal is t...

ALL of my email is gone- getting error message as well
I am getting this message: The message store has been corrupted by an application external to Windows Mail. Windows Mail has been able to successfully recover from this corruption. (0x0000000) In addition ALL of my emails are gone. Any suggestions on how I can recover them? And what I should do about the message. Try running the various repair functions in the WMUtil program: http://www.oehelp.com/WMUtil If still no improvement, upgrade to Windows Live Mail: http://download.live.com/wlmail It will automatically import all your WM data. Gary VanderMolen, Microsoft MVP (Mai...

Excel is creating temp files Help!!!
Hi i have to files in excel, i cant figure it out, whenever i open th files, they create temp files into the same location, when i shut dow the program the temp files are left there. Is their a way to make it so temp files are not saved. Or is their a way to make it so that the creation of temp files i turned off. Thanks jaso -- greenfalco ----------------------------------------------------------------------- greenfalcon's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=1362 View this thread: http://www.excelforum.com/showthread.php?threadid=26182 What do th...

How do I Restore old save dbx files back into OE store folder
I have some old dbx files that I saved into a folder in 'My documents' some time ago during earlier OE back ups. I now wish to re-import some of these saved dbx folders back into OE in order to assess some of these emails again. I've been looking at the wed sites 'Inside OE' and 'OE help'. But can't seem find or see the part that will give me directions on how to do this. Some of these saved dbx folders have the same names of existing folders that I'm currently using in OE. So presumably, I'm going to have to do some folder renaming or s...

How do I get address book to include e-mail address?
When I select to: box in the new message the search box does not include the e-mail address and is not included in the address line. How do i fix that? Any chance the Contacts folder has lost it's "Show this folder as an E-mail Address Book" checkmark in Properties? http://support.microsoft.com/kb/197577/en-us "Show this folder as an e-mail Address Book" check box is dimmed in Outlook Contact folder properties Hal -- Hal Hostetler, CPBE -- hhh@kvoa.com Senior Engineer/MIS -- MS MVP-Print/Imaging -- WA7BGX http://www.kvoa.com -- "When News breaks, we fix it!...

How Do I Copy My Outlook Files To My New Computer?
I exported my Outlook files from my old computer and burned them to a CD. During the export process, it asked me three times for a password. When I tried to import these files to my new computer I got "File access is denied. You do not have the permission required to access the file." Can anyone help? Apart from the fact that Import/Export options often lead to corruption - you should use a simple pst copy - The pst needs to be on the hd and the read only flag off, before In OL attempting to open it. NB not import <aprice6@hotmail.com> wrote in message news:1145746658.84...

how to edit my x-axis data on a line graph
Version: 2008 Operating System: Mac OS X 10.5 (Leopard) Processor: Intel my x axis data on my graph is just showing numbers 1 2 3 4 5 6 7 8 9 10 11.... and it is suppose to show the years. I can't figure out how to change these values ...

How do I get deleted items that stay in inbox with line thru them.
I inherited a computer at work. Outlook is setup so that when I delete a message it stays in the inbox, with a line thru it. How do I get the deleted items to go automatically to the deleted item folder? "rwwhit" <rwwhit@discussions.microsoft.com> wrote in message news:7D17761E-CD1B-4D04-BACB-B0D837C4DD93@microsoft.com... >I inherited a computer at work. Outlook is setup so that when I delete a > message it stays in the inbox, with a line thru it. How do I get the deleted > items to go automatically to the deleted item folder? That's normal behavior...

viewing LN emails (.nsf files) saved to CD in outlook?
I have lotus notes messages saved on CD, these are saved as .nsf files. Is there any way I can view these in Outlook? have tried various LN websites - to no avail. ...

Where can I get UNLIMITED Excel stock qoutes?
The Excel Add-in that allows you to retrieve stock qoutes is limited in taht it only allows you to get about 250 qoutes at a time. How can I get unlimited qoutes in a format compatible with excel? Z There's a program called Historical Stock Quotes which can create tab or comma delimited files that can be read into Excel. If you want something that updates automatically within Excel, you may have to buy an add-in. Have you searched the web? On Sun, 6 Mar 2005 12:18:23 -0800, ZouBCivil <ZouBCivil@discussions.microsoft.com> wrote: >The Excel Add-in that allows you to retriev...

Using XP Briefcase with money file
I put a copy of my money file into the laptop briefcase and I am able to keep them in sych for a while. For some reason I get locked out, the computer knows the file has been updated but it will not let the desk top file update the laptop file, I get the following message; "The source file can not be opened" "Check to see if the other program has the file opened, and close the file before updating the briefcase." Other files update just fine. When I get this message, I can't even drag a new copy of the Money file to my briefcase, I have to rename the file an...

Help with automating file name
I have the following code that exports the below query to excell. I would like the files name to include the month and date. How would I format this? DoCmd.OutputTo acOutputQuery, "qryShopOrderSqFtShippedSummaryExport",_ acFormatXLS, "W:\Cokato\Production\ProdRoomRpt.xls" -- Matt Campbell mattc (at) saunatec [dot] com Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/Forums.aspx/access-queries/200708/1 Hi, Matt. > I would > like the files name to include the month and date. Uh, . . . the date _always_ includes the month, unless you're r...

Windows XP: Open file in read-only: Word, Excel, Visio
I'm often sharing files on a network drive with someone. Often, one of us knows that we don't need to open a file for modification, and we only need read-access. Is there a way to open a file in read-only mode so that when someone does need to open it for modification, the read-only user is not blocking that? If there is not a way to do this native to Windows XP, is there a way to do it from the three applications that we use most, namely Word, Excel, Visio? All are 2003 versions. Thx. I used to save files like this in "read only recommended" mode. File|SaveAs|Tools|Ge...

outlook adreddbook file
I want to export the addressbook flie into database to be uses in a quiry. is it possible and how do i do it? Outlook has no separate "address book file." Contact data is stored in your Contacts Folder Use the Export Wizard to export it to the format that best suits your needs. -- Russ Valentine [MVP-Outlook] "Helpneeded" <derontayp@aol.com> wrote in message news:261e01c3af79$7d94e740$a601280a@phx.gbl... > I want to export the addressbook flie into database to be > uses in a quiry. is it possible and how do i do it? ...

Contact file not visible when importing or exporting contacts
I'm tidying up all my contacts files for email and also for my mobile ph using outlook. Have done this many times without any problems and am familiar with import export process. I exported all the contacts to an excel file to work on as it's much easier than through outlook. Had a hiccup at first as when I got to the select a contact file to export there was just a blank space. I exited outlook and went back in and it was all OK. Now I've finished the excel spreadhsheet and want to reimport it but it's the same problem in reverse. I can't "see" a co...

How to remove the /dde from Windows Explorer File Open on Install
I have an MDI app that I would like to open a file on a double click in Windows Explorer. Unfortunately the Explorer File Type (Tools>Folder Options... File Types tab) is set so that the command invokes dde. Ie. The "open" option under the "Advanced" button is C:\Path...\App.exe /dde and the DDE message is [open("%1")]. This never seems to work as my app never sees the dde message and the initialization of m_pCmdInfo via: m_pCmdInfo = (CCommandLineInfo*)(UINT_PTR)m_nCmdShow; sets the pointer to one and the app fails on exit. This is referred as a kn...

Force command to run for each computer in txt file list of compute
I have a few hundred computers that haven't been defragged in years. I was wondering if rather than doing it manually, if someone had a script where if i just put all the computer names in a txt file, it would iterate through the list and perform a "defrag c: -f" on them all from my workstation. The workstations all have the same local administrator password, so the process would be the same for each. I just dont know how to write scripts. I know if i were going to do this manually from my computer I would run the command below for each ComputerName psexec ...

getting IIS login credentials
In my webforms app, I am using Page.Users.Identity.Name to get the user name. Does anyone know what the MFC equivalent is? I am wanting to modify the MFC code of an older application to do some stuff that I am doing in a webapp. ...

Cannot get CRM client for Outlook online
One of my customer's employees is having problems to get his CRM client for Outlook online (version 3.0). The error he is receiving says: "An unknown error has occurred. Retry the action. If the problem persists, contact your system administrator.". In the event log we find the following warning message: Event Type: Warning Event Source: MSCRMAddressBook Event Category: None Event ID: 6425 Date: 10/12/2006 Time: 1:53:18 PM User: N/A Computer: AVELTP0131 Description: The current user does not have permission to use the Microsoft CRM Address Book. Contact the system administr...

Publisher 2003 files try to open in Publisher 97 #2
Back again, but with a different Pub 2003/Pub97 issue Have Office 2003 with Publisher 2003 and Publisher 97 both on my XP Pro system Recently I find that files created in Pub 2003 are being saved as files with the Pub 97 Logo, and when you try to open them from the file listing, they open Pub 97, which correctly posts a box telling me that it cant open the files. If I use Publisher 2003 to open the same files from within the application the work fine. When I select a 2003 Pub file which contains the Pub 97 icon, the file list does not contain Publisher 2003, but when I browse and locat...

How to get rid of a "line" in Word
If I type a number of dashes in Word and press Return it automatically gets changed into a continuous line. How do I later remove such a line? Sometimes if I delete the text line above it then the line also goes but often I just can't get rid of it. I have to resort to creating a new document and then copy/paste the god bits over and then delete the old document. Thanks. -- Les Desser (The Reply-to address IS valid) In news:lzqSlgmVscxLFAoG@dessergr0up.invalid, Les Desser <NewsDump1@dessergroup.com> typed: > If I type a number of dashes in Word and press ...

Where can I get a template that will calculate profloss after buy.
I need a template that will calculate all the possible variables in a share trade. The rate on buying, every day entry (7 days),Profit/loss on holding, prof/loss on sale etc. ...