Click here to Skip to main content
15,923,222 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Dos windows invisible Pin
JudyL_MD22-Jan-08 2:36
JudyL_MD22-Jan-08 2:36 
GeneralRe: Dos windows invisible Pin
Rajesh R Subramanian21-Jan-08 21:29
professionalRajesh R Subramanian21-Jan-08 21:29 
GeneralUpdating source control status...Nightmare Pin
AbbyIndian21-Jan-08 0:40
AbbyIndian21-Jan-08 0:40 
GeneralRe: Updating source control status...Nightmare Pin
MrdavidOgle25-Feb-11 14:18
MrdavidOgle25-Feb-11 14:18 
GeneralReading .reg file. Pin
neha.agarwal2720-Jan-08 21:26
neha.agarwal2720-Jan-08 21:26 
GeneralRe: Reading .reg file. Pin
jhwurmbach20-Jan-08 21:46
jhwurmbach20-Jan-08 21:46 
GeneralRe: Reading .reg file. Pin
neha.agarwal2720-Jan-08 23:00
neha.agarwal2720-Jan-08 23:00 
GeneralRe: Reading .reg file. Pin
jhwurmbach21-Jan-08 2:18
jhwurmbach21-Jan-08 2:18 
What is the third param of CStdIoFile-c'tor?
My MSDN only shows two parameters there: filename and flags.
Other than that, I don't see what is wrong with your code.

This console-program uses std C++ streams instead as MFC, but it works as intended:
#include "stdafx.h"
#undef max   //even out some MFC-idiocity
#undef min
#include "iostream"
#include "fstream"
#include "limits"

int _tmain(int argc, _TCHAR* argv[])
{
	std::string str;
	std::ifstream ptr;
	ptr.open("C:\\Documents and Settings\\Mac01\\My Documents\\web.reg");
	if( ptr.is_open())	{
		std::getline( ptr, str);
		while( ptr){
			std::cout << str << std::endl;	
			std::getline( ptr, str);
		}
	}
	else	{
		std::cout << "Unable to open file!" << std::endl;
	}
	return ::system( "pause");
}
The harder part is interpreting the lines you read.
In '[' and ']' you find the name of the Registry to open, and below that you find key/value-pairs of keys to set.

Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all.
Douglas Adams, "Dirk Gently's Holistic Detective Agency"

GeneralRe: Reading .reg file. Pin
Michael Schubert21-Jan-08 5:08
Michael Schubert21-Jan-08 5:08 
GeneralRe: Reading .reg file. Pin
jhwurmbach21-Jan-08 5:37
jhwurmbach21-Jan-08 5:37 
GeneralRe: Reading .reg file. Pin
Michael Schubert21-Jan-08 6:40
Michael Schubert21-Jan-08 6:40 
GeneralRe: Reading .reg file. Pin
Don Box20-Jan-08 23:26
Don Box20-Jan-08 23:26 
Generalcheck box problem... Pin
Chandrasekharan P20-Jan-08 21:16
Chandrasekharan P20-Jan-08 21:16 
GeneralRe: check box problem... Pin
baerten20-Jan-08 21:40
baerten20-Jan-08 21:40 
GeneralRe: check box problem... Pin
Chandrasekharan P20-Jan-08 22:18
Chandrasekharan P20-Jan-08 22:18 
GeneralRe: check box problem... Pin
baerten20-Jan-08 22:26
baerten20-Jan-08 22:26 
QuestionRe: check box problem... Pin
CPallini20-Jan-08 22:22
mveCPallini20-Jan-08 22:22 
GeneralRe: check box problem... Pin
baerten20-Jan-08 22:28
baerten20-Jan-08 22:28 
GeneralRe: check box problem... Pin
CPallini20-Jan-08 22:21
mveCPallini20-Jan-08 22:21 
GeneralRe: check box problem... Pin
Chandrasekharan P20-Jan-08 22:37
Chandrasekharan P20-Jan-08 22:37 
GeneralRe: check box problem... Pin
CPallini20-Jan-08 22:43
mveCPallini20-Jan-08 22:43 
GeneralRe: check box problem... Pin
Chandrasekharan P20-Jan-08 22:46
Chandrasekharan P20-Jan-08 22:46 
GeneralRe: check box problem... Pin
CPallini20-Jan-08 22:53
mveCPallini20-Jan-08 22:53 
GeneralRe: check box problem... Pin
Chandrasekharan P20-Jan-08 22:58
Chandrasekharan P20-Jan-08 22:58 
QuestionRe: check box problem... Pin
CPallini20-Jan-08 23:10
mveCPallini20-Jan-08 23:10 

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.