Click here to Skip to main content
15,030,320 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionhow to put blank line in Excel Pin
tunminhein19-Sep-07 0:44
Membertunminhein19-Sep-07 0:44 
AnswerRe: how to put blank line in Excel Pin
David Crow19-Sep-07 2:46
MemberDavid Crow19-Sep-07 2:46 
GeneralRe: how to put blank line in Excel Pin
tunminhein19-Sep-07 3:28
Membertunminhein19-Sep-07 3:28 
GeneralRe: how to put blank line in Excel Pin
David Crow19-Sep-07 3:31
MemberDavid Crow19-Sep-07 3:31 
GeneralRe: how to put blank line in Excel Pin
tunminhein19-Sep-07 3:45
Membertunminhein19-Sep-07 3:45 
GeneralRe: how to put blank line in Excel Pin
tunminhein19-Sep-07 4:23
Membertunminhein19-Sep-07 4:23 
GeneralRe: how to put blank line in Excel Pin
David Crow19-Sep-07 5:31
MemberDavid Crow19-Sep-07 5:31 
GeneralRe: how to put blank line in Excel Pin
tunminhein19-Sep-07 5:40
Membertunminhein19-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:
GeneralRe: how to put blank line in Excel Pin
David Crow19-Sep-07 5:50
MemberDavid Crow19-Sep-07 5:50 
GeneralRe: how to put blank line in Excel Pin
tunminhein19-Sep-07 5:56
Membertunminhein19-Sep-07 5:56 
GeneralRe: how to put blank line in Excel Pin
David Crow19-Sep-07 6:03
MemberDavid Crow19-Sep-07 6:03 
GeneralRe: how to put blank line in Excel Pin
tunminhein19-Sep-07 6:20
Membertunminhein19-Sep-07 6:20 
GeneralRe: how to put blank line in Excel Pin
David Crow19-Sep-07 6:55
MemberDavid Crow19-Sep-07 6:55 
GeneralRe: how to put blank line in Excel Pin
tunminhein23-Sep-07 11:54
Membertunminhein23-Sep-07 11:54 
Question_aligned_malloc Problem! Pin
bosfan19-Sep-07 0:18
Memberbosfan19-Sep-07 0:18 
AnswerRe: _aligned_malloc Problem! Pin
toxcct19-Sep-07 0:34
Membertoxcct19-Sep-07 0:34 
GeneralRe: _aligned_malloc Problem! Pin
bosfan19-Sep-07 0:49
Memberbosfan19-Sep-07 0:49 
GeneralRe: _aligned_malloc Problem! Pin
Matthew Faithfull19-Sep-07 1:03
MemberMatthew Faithfull19-Sep-07 1:03 
GeneralRe: _aligned_malloc Problem! Pin
bosfan19-Sep-07 1:08
Memberbosfan19-Sep-07 1:08 
AnswerRe: _aligned_malloc Problem! Pin
Matthew Faithfull19-Sep-07 1:31
MemberMatthew Faithfull19-Sep-07 1:31 
GeneralRe: _aligned_malloc Problem! Pin
bosfan19-Sep-07 3:06
Memberbosfan19-Sep-07 3:06 
AnswerRe: _aligned_malloc Problem! Pin
Randor 19-Sep-07 1:39
professional Randor 19-Sep-07 1:39 
GeneralRe: _aligned_malloc Problem! Pin
bosfan19-Sep-07 3:09
Memberbosfan19-Sep-07 3:09 
QuestionTab Control Related problem Pin
Y_Kaushik18-Sep-07 23:55
MemberY_Kaushik18-Sep-07 23:55 
AnswerRe: Tab Control Related problem Pin
nbugalia19-Sep-07 0:20
Membernbugalia19-Sep-07 0:20 

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.