Click here to Skip to main content
15,914,074 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralStatus bar in ATL COM Exe Pin
shakiru11-Nov-04 0:22
shakiru11-Nov-04 0:22 
GeneralATL web service scope Pin
De Nardis Andrea10-Nov-04 8:38
De Nardis Andrea10-Nov-04 8:38 
GeneralATL in .NET Studio... Pin
CherezZaboro10-Nov-04 7:45
CherezZaboro10-Nov-04 7:45 
GeneralRe: ATL in .NET Studio... Pin
De Nardis Andrea10-Nov-04 8:33
De Nardis Andrea10-Nov-04 8:33 
GeneralATL web server and smart pointers Pin
De Nardis Andrea9-Nov-04 4:14
De Nardis Andrea9-Nov-04 4:14 
GeneralRe: ATL web server and smart pointers Pin
Igor Vigdorchik9-Nov-04 14:53
Igor Vigdorchik9-Nov-04 14:53 
GeneralRe: ATL web server and smart pointers Pin
De Nardis Andrea9-Nov-04 22:33
De Nardis Andrea9-Nov-04 22:33 
GeneralSreaming maps and vectors to a file Pin
Malcolm Smart8-Nov-04 23:31
Malcolm Smart8-Nov-04 23:31 
Hi

I am trying to stream a map container to and from a file...

map<string , string > testMap;<br />
testMap.insert(pair<string , string>("one" , "This is string one"));<br />
testMap.insert(pair<string , string>("two" , "This is string two"));<br />
testMap.insert(pair<string , string>("three" , "This is string three"));<br />
<br />
copy(testMap.begin() , testMap.end() , ostream_iterator< pair<string , string> >(ofstream("C:\\myfile.txt") ));



Dead | X| It won't even compile! I've done similar with vectors without a problem....

vector<string> testVector;<br />
testVector.push_back("This is string one");<br />
testVector.push_back("This is string two");<br />
testVector.push_back("This is string three");<br />
<br />
copy(testVector.begin() , testVector.end() , ostream_iterator< string >(ofstream("C:\\myfile.txt") ));



This is really only a pre-amble to my next question...

If I got the above to work the file would look similar to...

<br />
//map output<br />
<br />
oneThis is string onetwoThis is string twothreeThis is string three<br />
<br />
//or vector output<br />
This is string oneThis is string twoThis is string three<br />




So reading in would be 'not easy' to say the least. Using an istream_iterator would not know where to break the string. There must be an easy way of streaming maps (or vector<string>) to a file and reading them back in....

Somebody must have a snippet of code they can post....?Big Grin | :-D

Cheers

Angel

*********************************************
The sooner you fall behind, the longer you have to catch up.
GeneralRe: Sreaming maps and vectors to a file Pin
Steve S9-Nov-04 0:07
Steve S9-Nov-04 0:07 
GeneralRe: Sreaming maps and vectors to a file Pin
Andrew Walker9-Nov-04 2:06
Andrew Walker9-Nov-04 2:06 
GeneralRe: Sreaming maps and vectors to a file Pin
Malcolm Smart9-Nov-04 4:37
Malcolm Smart9-Nov-04 4:37 
QuestionHow to import MFC DLL into WTL project Pin
humbird8-Nov-04 2:33
humbird8-Nov-04 2:33 
AnswerRe: How to import MFC DLL into WTL project Pin
Michael Dunn8-Nov-04 6:52
sitebuilderMichael Dunn8-Nov-04 6:52 
QuestionATL DLL? Pin
dSolariuM5-Nov-04 17:49
dSolariuM5-Nov-04 17:49 
AnswerRe: ATL DLL? Pin
ThatsAlok8-Nov-04 18:47
ThatsAlok8-Nov-04 18:47 
GeneralATL Server: Catch all resources Pin
Diep-Virezer5-Nov-04 4:14
Diep-Virezer5-Nov-04 4:14 
GeneralAbout Runtime and Developer Component Pin
ThatsAlok3-Nov-04 20:26
ThatsAlok3-Nov-04 20:26 
GeneralATL property page can't get WM_HELP message Pin
CodewithJoe2-Nov-04 21:26
CodewithJoe2-Nov-04 21:26 
GeneralRe: ATL property page can't get WM_HELP message Pin
CodewithJoe2-Nov-04 21:34
CodewithJoe2-Nov-04 21:34 
GeneralCAxDialogImpl Pin
atabac1-Nov-04 9:34
atabac1-Nov-04 9:34 
GeneralRe: CAxDialogImpl Pin
Michael Dunn2-Nov-04 10:57
sitebuilderMichael Dunn2-Nov-04 10:57 
Generalexport attribute with struct / enum Pin
DrGreen1-Nov-04 4:04
DrGreen1-Nov-04 4:04 
GeneralRe: export attribute with struct / enum Pin
RChin3-Nov-04 6:38
RChin3-Nov-04 6:38 
GeneralRe: export attribute with struct / enum Pin
User 21559716-Nov-04 0:20
User 21559716-Nov-04 0:20 
GeneralWTL resource leak Pin
nm_11431-Oct-04 7:08
nm_11431-Oct-04 7:08 

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.