Click here to Skip to main content
15,905,682 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionInsertion of Smiley Faces in Rich Edit Control Pin
_Shiva19-Sep-07 1:53
_Shiva19-Sep-07 1:53 
AnswerRe: Insertion of Smiley Faces in Rich Edit Control Pin
David Crow19-Sep-07 2:43
David Crow19-Sep-07 2:43 
QuestionAdjusting the size of the page in the property sheet Pin
Nishad S19-Sep-07 1:27
Nishad S19-Sep-07 1:27 
AnswerRe: Adjusting the size of the page in the property sheet Pin
KarstenK19-Sep-07 2:22
mveKarstenK19-Sep-07 2:22 
AnswerRe: Adjusting the size of the page in the property sheet Pin
David Crow19-Sep-07 2:44
David Crow19-Sep-07 2:44 
GeneralRe: Adjusting the size of the page in the property sheet Pin
Nishad S19-Sep-07 19:09
Nishad S19-Sep-07 19:09 
GeneralRe: Adjusting the size of the page in the property sheet Pin
Nelek19-Sep-07 20:18
protectorNelek19-Sep-07 20:18 
GeneralRe: Adjusting the size of the page in the property sheet Pin
Nishad S19-Sep-07 20:32
Nishad S19-Sep-07 20:32 
GeneralRe: Adjusting the size of the page in the property sheet Pin
Nelek19-Sep-07 22:02
protectorNelek19-Sep-07 22:02 
GeneralRe: Adjusting the size of the page in the property sheet Pin
Nishad S19-Sep-07 22:23
Nishad S19-Sep-07 22:23 
GeneralRe: Adjusting the size of the page in the property sheet Pin
Nelek20-Sep-07 4:06
protectorNelek20-Sep-07 4:06 
GeneralRe: Adjusting the size of the page in the property sheet Pin
David Crow20-Sep-07 2:29
David Crow20-Sep-07 2:29 
GeneralRe: Adjusting the size of the page in the property sheet Pin
Nishad S20-Sep-07 18:49
Nishad S20-Sep-07 18:49 
QuestionRe: Adjusting the size of the page in the property sheet Pin
David Crow21-Sep-07 2:41
David Crow21-Sep-07 2:41 
AnswerRe: Adjusting the size of the page in the property sheet Pin
Nishad S21-Sep-07 23:52
Nishad S21-Sep-07 23:52 
GeneralRe: Adjusting the size of the page in the property sheet Pin
David Crow22-Sep-07 16:35
David Crow22-Sep-07 16:35 
Question[PacketSniffing] Tcp packet ordering and SIO_RCVALL. Pin
ioctl5119-Sep-07 1:08
ioctl5119-Sep-07 1:08 
Questionhow to put blank line in Excel Pin
tunminhein19-Sep-07 0:44
tunminhein19-Sep-07 0:44 
AnswerRe: how to put blank line in Excel Pin
David Crow19-Sep-07 2:46
David Crow19-Sep-07 2:46 
GeneralRe: how to put blank line in Excel Pin
tunminhein19-Sep-07 3:28
tunminhein19-Sep-07 3:28 
GeneralRe: how to put blank line in Excel Pin
David Crow19-Sep-07 3:31
David Crow19-Sep-07 3:31 
GeneralRe: how to put blank line in Excel Pin
tunminhein19-Sep-07 3:45
tunminhein19-Sep-07 3:45 
GeneralRe: how to put blank line in Excel Pin
tunminhein19-Sep-07 4:23
tunminhein19-Sep-07 4:23 
GeneralRe: how to put blank line in Excel Pin
David Crow19-Sep-07 5:31
David Crow19-Sep-07 5:31 
GeneralRe: how to put blank line in Excel Pin
tunminhein19-Sep-07 5:40
tunminhein19-Sep-07 5:40 
Thanks for respone.

the following is codeing -

#include "StdAfx.h"
#include "DataCollector.h"
#include "lmcons.h" // for UNLEN and DNLEN [Dave]


CDataCollector::CDataCollector(void)
{
}

CDataCollector::~CDataCollector(void)
{
}

void CDataCollector::Open(LPCTSTR path)
{
m_file.Open (path,CFile::modeCreate | CFile::modeNoTruncate |
CFile::modeWrite | CStdioFileEx::modeWriteUnicode );
m_file.SeekToEnd ();
}

void CDataCollector::Close()
{
m_file.Close ();
}

void CDataCollector::Write(LPCTSTR lesson,
LPCTSTR sentence, LPCTSTR attempt, double score)
{
// To get user name
CString s;
DWORD userNameLength = UNLEN + 1;
TCHAR userName[UNLEN + 1]; // System user name length + 1.

if (GetUserName(userName, &userNameLength))
{
/* get network name */
// The NetApi calls are very time consuming
// This technique gets the domain name via an
// environment variable
TCHAR domainName[DNLEN + 1]; // System domain name length + 1
if (ExpandEnvironmentStrings(_T("%USERDOMAIN%"), domainName, DNLEN + 1))
{
s += domainName;
s += '-';
} /* get network name */

s += userName;
}

//create the time object

time_t osBinaryTime;
time(&osBinaryTime);
CTime now(osBinaryTime);
CString strTime = now.Format(_T("%d/%m/%y %H:%M:%S\n "));


CString str;
str.Format(_T("\n"));
str.Format(_T("%s, %s, %s, %s, %3.0lf%%, %s \n"), lesson, s, sentence, attempt, score, strTime);
m_file.WriteString (str);


}

thanks a lot D'Oh! | :doh:

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.