Click here to Skip to main content
15,885,278 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: std:strstream does not work Pin
Richard MacCutchan22-Dec-20 23:37
mveRichard MacCutchan22-Dec-20 23:37 
GeneralRe: std:strstream does not work Pin
Stefan_Lang23-Dec-20 23:59
Stefan_Lang23-Dec-20 23:59 
AnswerRe: std:strstream does not work Pin
Stefan_Lang23-Dec-20 23:56
Stefan_Lang23-Dec-20 23:56 
GeneralRe: std:strstream does not work Pin
Haakon S.24-Dec-20 0:37
Haakon S.24-Dec-20 0:37 
GeneralRe: std:strstream does not work Pin
Richard MacCutchan24-Dec-20 4:18
mveRichard MacCutchan24-Dec-20 4:18 
GeneralRe: std:strstream does not work Pin
Stefan_Lang24-Dec-20 5:10
Stefan_Lang24-Dec-20 5:10 
GeneralRe: std:strstream does not work Pin
Haakon S.24-Dec-20 11:59
Haakon S.24-Dec-20 11:59 
AnswerRe: std:strstream does not work. Solution (sort of) Pin
Haakon S.26-Dec-20 1:11
Haakon S.26-Dec-20 1:11 
Hi.

I have managed to make things work, albeit not in the way I want to.

The data to be read is in a file called datf.txt. Having this file in the same directory as the exe file and simply writing

std::ifstream read_file("datf.txt");


is working. However, I want to have the data incorporated as part of the exe file. I have therefore included the CResourceTextFile class by Hans Dietrich. In the progarm resource:

IDU_COMP_FILE           TEXT                    "datf.txt"	


and further

CResourceTextFile rf;
rf.Open(NULL, _T("IDU_COMP_FILE"));
TCHAR* filbuf=rf.GetTextBuffer();
std::ifstream read_file(filbuf);


does not work anymore. It did for sstream in the older version of C++ but not for ifstream in the latest.
GeneralRe: std:strstream does not work. Solution (sort of) Pin
Randor 26-Dec-20 3:28
professional Randor 26-Dec-20 3:28 
QuestionConfigure Script Issue Pin
jblixt21-Dec-20 12:37
professionaljblixt21-Dec-20 12:37 
AnswerRe: Configure Script Issue Pin
Randor 21-Dec-20 13:01
professional Randor 21-Dec-20 13:01 
AnswerRe: Configure Script Issue Pin
k505421-Dec-20 17:42
mvek505421-Dec-20 17:42 
QuestionWriting a Factory Design Pattern Program with separate Header Files and Class Implementations Pin
Litu Sahoo17-Dec-20 12:26
Litu Sahoo17-Dec-20 12:26 
AnswerRe: Writing a Factory Design Pattern Program with separate Header Files and Class Implementations Pin
Gerry Schmitz17-Dec-20 19:27
mveGerry Schmitz17-Dec-20 19:27 
AnswerRe: Writing a Factory Design Pattern Program with separate Header Files and Class Implementations Pin
Richard MacCutchan17-Dec-20 23:36
mveRichard MacCutchan17-Dec-20 23:36 
QuestionBeginning C++ for Windows Application Pin
chipp_zanuff13-Dec-20 6:06
chipp_zanuff13-Dec-20 6:06 
AnswerRe: Beginning C++ for Windows Application Pin
Gerry Schmitz13-Dec-20 6:19
mveGerry Schmitz13-Dec-20 6:19 
QuestionRe: Beginning C++ for Windows Application Pin
Richard MacCutchan13-Dec-20 6:32
mveRichard MacCutchan13-Dec-20 6:32 
Questioncmath.h compile error Pin
Haakon S.9-Dec-20 21:20
Haakon S.9-Dec-20 21:20 
AnswerRe: cmath.h compile error Pin
CPallini9-Dec-20 21:39
mveCPallini9-Dec-20 21:39 
GeneralRe: cmath.h compile error Pin
Haakon S.10-Dec-20 0:51
Haakon S.10-Dec-20 0:51 
GeneralRe: cmath.h compile error Pin
CPallini10-Dec-20 1:16
mveCPallini10-Dec-20 1:16 
AnswerRe: cmath.h compile error Pin
Greg Utas10-Dec-20 1:04
professionalGreg Utas10-Dec-20 1:04 
GeneralRe: cmath.h compile error Pin
Haakon S.10-Dec-20 1:58
Haakon S.10-Dec-20 1:58 
GeneralRe: cmath.h compile error Pin
Greg Utas10-Dec-20 2:19
professionalGreg Utas10-Dec-20 2:19 

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.