[Solved] How to Read and write into/from a text file?

This line fprintf(l_pFile, sVar); doesn’t look right. I think it should be fprintf(l_pFile, “%s\n”, (LPCTSTR) sVar); The loop could become infinite if the file has less than two linefeeds: while(count != 2) I think it should be: while( (count < 2) && ( ! feof(l_pFile) ) && ( c != EOF ) ) Probably unrelated … Read more

[Solved] Pointer stored in int

From the documentation pbParamInfo – Pointer to a null-terminated string of bytes specifying the types of the parameters following pbParamInfo. … – Variable list of parameters, of types specified in pbParamInfo. You are passing NULL for pbParamInfo, which I assume means that no data will be stored in the returned variant, so of course the … Read more

[Solved] get the first letter of each word in a string using c++ [closed]

cout<<myString[0]; for(int i=0;i<(myString.size-1);i++) { if(myString[i]==” “) { cout<< myString[i+1]; { } I didn’t checked if it compiles that way but you schould get the idea of this possible simple solution. It will only work with strings similar to your example. You should take a look at the Split Method like others already suggested. 4 solved … Read more

[Solved] execute program while window handled mfc

It sounds like you need a windows hook. http://msdn.microsoft.com/en-us/library/windows/desktop/ms644959(v=vs.85).aspx#whgetmessagehook with WH_GETMESSAGE you get to see the windows events being processed by the other application’s window, you could then wait for the WM_CLOSE to show up, and kill your dialog. solved execute program while window handled mfc