Click here to Skip to main content
15,893,814 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: TAPI send data Pin
Richard MacCutchan12-Dec-09 6:04
mveRichard MacCutchan12-Dec-09 6:04 
GeneralRe: TAPI send data Pin
cmos12-Dec-09 14:19
cmos12-Dec-09 14:19 
GeneralRe: TAPI send data Pin
Richard MacCutchan12-Dec-09 22:52
mveRichard MacCutchan12-Dec-09 22:52 
GeneralRe: TAPI send data Pin
cmos13-Dec-09 1:18
cmos13-Dec-09 1:18 
GeneralRe: TAPI send data Pin
Richard MacCutchan13-Dec-09 1:33
mveRichard MacCutchan13-Dec-09 1:33 
AnswerRe: TAPI send data Pin
armecos22-Feb-10 17:01
armecos22-Feb-10 17:01 
QuestionWriting in a file using CArchive class Pin
Le@rner11-Dec-09 22:47
Le@rner11-Dec-09 22:47 
AnswerRe: Writing in a file using CArchive class Pin
Nuri Ismail11-Dec-09 23:51
Nuri Ismail11-Dec-09 23:51 
Le@rner wrote:
but when i open the file the content inside it is

Apþÿÿ ?ñÔÈSû! @


This is absolutely normal because CArchive will write your data in binary mode. Smile | :)

If you want to write a text file you can use the CStdioFile[^] class like this:
CStdioFile file;
CFileException e;
if(!file.Open(_T("C:\\file.txt"), CFile::modeCreate | CFile::modeWrite | CFile::typeText, &e))
{
	TRACE(_T("File could not be opened %d\n"), e.m_cause);
}
else
{
        char c = 'A';
	int i = -400;
	float f = 1.25f;
	double d = 3.14159265;
	
        CString str;
	str.Format(_T("%c %d %f %f"), c, i, f, d);
	
        file.WriteString(str);
	file.Close();
}


Using the STL file streams could also be an option. In this case the code could be something like:
#include <fstream>

// Deal with both Unicode and Non-Unicode builds
#ifdef _UNICODE
	#define _tofstream std::wofstream
#else
	#define _tofstream std::ofstream
#endif

........

char c = 'A';
int i = -400;
float f = 1.25f;
double d = 3.14159265;
	
_tofstream fout;
fout.open(_T("C:\\file.txt"));
fout << c << _T(" ")<< i << _T(" ") << f << _T(" ")<< d;
fout.close();


I hope this helps! Smile | :)

Regards

Nuri Ismail
AnswerRe: Writing in a file using CArchive class Pin
pacotest17-Dec-09 18:42
pacotest17-Dec-09 18:42 
QuestionNamed Mutex not visible from DLL Pin
Bram van Kampen11-Dec-09 15:03
Bram van Kampen11-Dec-09 15:03 
AnswerRe: Named Mutex not visible from DLL Pin
«_Superman_»11-Dec-09 18:37
professional«_Superman_»11-Dec-09 18:37 
AnswerRe: Named Mutex not visible from DLL Pin
Rajesh R Subramanian11-Dec-09 22:29
professionalRajesh R Subramanian11-Dec-09 22:29 
GeneralRe: Named Mutex not visible from DLL Pin
krmed12-Dec-09 4:16
krmed12-Dec-09 4:16 
AnswerRe: Named Mutex not visible from DLL Pin
Rajesh R Subramanian12-Dec-09 4:52
professionalRajesh R Subramanian12-Dec-09 4:52 
GeneralRe: Named Mutex not visible from DLL Pin
krmed12-Dec-09 5:14
krmed12-Dec-09 5:14 
GeneralRe: Named Mutex not visible from DLL Pin
Rajesh R Subramanian12-Dec-09 6:15
professionalRajesh R Subramanian12-Dec-09 6:15 
GeneralRe: Named Mutex not visible from DLL Pin
Bram van Kampen12-Dec-09 15:46
Bram van Kampen12-Dec-09 15:46 
GeneralRe: Named Mutex not visible from DLL Pin
Bram van Kampen12-Dec-09 16:54
Bram van Kampen12-Dec-09 16:54 
GeneralRe: Named Mutex not visible from DLL Pin
Rajesh R Subramanian12-Dec-09 18:54
professionalRajesh R Subramanian12-Dec-09 18:54 
GeneralRe: Named Mutex not visible from DLL Pin
Bram van Kampen14-Dec-09 12:25
Bram van Kampen14-Dec-09 12:25 
AnswerRe: Named Mutex not visible from DLL Pin
Richard MacCutchan12-Dec-09 1:46
mveRichard MacCutchan12-Dec-09 1:46 
GeneralRe: Named Mutex not visible from DLL Pin
Bram van Kampen12-Dec-09 16:08
Bram van Kampen12-Dec-09 16:08 
GeneralRe: Named Mutex not visible from DLL Pin
Richard MacCutchan12-Dec-09 22:55
mveRichard MacCutchan12-Dec-09 22:55 
AnswerRe: Named Mutex not visible from DLL Pin
Migounette13-Dec-09 2:36
Migounette13-Dec-09 2:36 
GeneralRe: Named Mutex not visible from DLL Pin
Bram van Kampen13-Dec-09 21:34
Bram van Kampen13-Dec-09 21:34 

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.