|
But tab control size is managed by the property sheet, right? So always there will be a gap between the tab controls' border and that of page...
- NS -
|
|
|
|
|
NS17 wrote: But tab control size is managed by the property sheet, right?
See here.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
When using ioctl() to set SIO_RCVALL in order to be able to use recvfrom() to "sniff" all incoming and outgoing packets, will TCP packets already be "ordered (arrive in same order as sent)" and and reliable in the sense that a copy of an already received packet can arrive at a later time?
Or does SIO_RCVALL hook the packets before the tcp implementation have done its work, and you have to do this ordering and detecting dupes yourself?
Thanks
|
|
|
|
|
Hi guys,
I've got some problem with C++/MFC application. Now I would like to put the blank line in excel between different date.
I already done to create output Excel file. In my file is -
//create the time object
CString strTime = now.format (_T("%d/%m/%y %H:%M%S"));
CString str;
str.format ( _T("%s, %s, %s, %s, %3.0lf%%, %s \n"), lesson, s, sentence, attempt, score, strTime);
m_file.WriteString (str);
the strTime is to display the current time. I want to do when the datetime column is differnent data, just put the blank line.
example line -
RSVP-test-1 username The sentence The sentence 100% 18/09/07
RSVP-test-1 username The sentence The sentence 100% 19/09/07
Can anyone help me ?
|
|
|
|
|
tunminhein wrote: I want to do when the datetime column is differnent data, just put the blank line.
Can't you just add another '\n' to str ?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi David,
very useful answer. but I don't want to get gap line every line.
just want it, when the date time is different.
Thank you very much
tunminhein
|
|
|
|
|
Obviously you'll need to compare the previous time with the current time and only add the extra '\n' when they differ.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Thank a lot david,
I'll try it now.
regards,
tunminhein
|
|
|
|
|
Excause me again, David
How can i get the data from excel column 6.
thanks a lot.
|
|
|
|
|
tunminhein wrote: How can i get the data from excel column 6.
Without any more data than you've provided, I don't know. I would presume in the opposite manner in which you are setting the data in column 6.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
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
|
|
|
|
|
tunminhein wrote: str.Format(_T("\n"));
str.Format(_T("%s, %s, %s, %s, %3.0lf%%, %s \n"), lesson, s, sentence, attempt, score, strTime);
What exactly are you expecting this to do? The second call to Format() just overrides what the first one did.
In any case, you need to compare:
if (last_time != strTime)
m_file.WriteString(_T("\n"));
str.Format(_T("%s, %s, %s, %s, %3.0lf%%, %s \n"), lesson, s, sentence, attempt, score, strTime);
m_file.WriteString (str);
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Thanks a lot david
but we didn't put anydata to last_time ?
Regards,
|
|
|
|
|
tunminhein wrote: but we didn't put anydata to last_time ?
I assumed you knew that must be done and how to do it.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I haven't known yet how to put the previous date data to last_time.
but I tried it that u advice's coding.
here we are,
time_t osBinaryTime;
time(&osBinaryTime);
CTime now(osBinaryTime);
CString strTime = now.Format(_T("%d/%m/%y "));
CString strClock = now.Format (_T(" %H:%M:%S"));
/* CString last_time = strTime.Format (_T("%d/%m/%y "));
//
Cstring str;
if (last_time != strTime){
//m_file.WriteString(_T("\n"));
str.Format(_T("%s, %s, %s, %s, %3.0lf%%, %s , %s\n"), lesson, s, sentence, attempt, score, strTime,StrClock);
m_file.WriteString (str);
)*/
but i got error on the CSting last_time = strTime.format(_T(" %d/%m/%y"));
I'm a beginner in the MFC application. I really sorry u, if u got any inconvience.
thanks again.
|
|
|
|
|
tunminhein wrote: but i got error on the CSting last_time = strTime.format(_T(" %d/%m/%y"));
And rightly so, since CString::Format() has no return value.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
|
Hello,
i found one sample on msdn how to use Singly Linked Lists, and when i try to
build i got this error:
error C2065: '_aligned_malloc' : undeclared identifier
error C2065: '_aligned_free' : undeclared identifier
Can someone explain me how to fix this?
regards
termal
|
|
|
|
|
did you forget some of the #includes ?
|
|
|
|
|
Hello,
thanx for reply, i dont know, i copy all from this site on msdn!
My local msdn dont know this function!
regards
termal
|
|
|
|
|
OK. _aligned_malloc is a memory allocation function in the Visual C Runtime, MSVCRT*.dll.
It isn't usually called directly although I think it is exported. _aligned_free is the matching memory deallocation function. You need to check your project settings for which CLibrary/CRuntime you're using and look at the code to see whether it's using new or malloc or calloc or calling _aligned_malloc directly. Then you may need to add a #include or two. It's difficult to give you more details without knowing which Visual Studio version you're using and closely examining the sample.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
Hello,
thanks for assertion, i use VS6 and my sample is from msdn, link to the site is in my first post!
regards!
termal
|
|
|
|
|
Hmm I'm confused now, The message that turned up in my email is not the message you posted here?!?
Hi,
i change the original line with _aligned_malloc:
pListHead = (PSLIST_HEADER)_aligned_malloc(sizeof(SLIST_HEADER), MEMORY_ALLOCATION_ALIGNMENT);
to:
pListHead = (PSLIST_HEADER)malloc(MEMORY_ALLOCATION_ALIGNMENT);
and i dont have errors! [confused]
regards
termal
Anyway you'll need to change that to
pListHead = (PSLIST_HEADER)malloc( sizeof(SLIST_HEADER) );
or you certainly will get errors when you run it. The original problem may be that _aligned_malloc is no longer exported from the Visual C Runtime, or it might require you to add an addtional include over and above memory.h e.g. #include <dbg.h> from the C Library source. Either way I wouldn't recommend calling _aligned_malloc directly from your code as it's intended to be an internal function. It will get called from malloc anyway, at least in debug mode, several levels down. If you installed the C Library source code along with VC++ 6 you can step into the malloc call in the debugger and marvel at the amount of stuff that happens just to get you a few bytes of memory to play with. Enjoy.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
Hello,
yes you have right, i delete my previous message because is wrong, i change it like you said!
regards
termal
|
|
|
|
|
To use _aligned_malloc() with Visual Studio 6 you will need to download and install the Microsoft Platform SDK.
http://www.microsoft.com/downloads/details.aspx?familyid=0BAF2B35-C656-4969-ACE8-E4C0C0716ADB[^]
Side Note: The aligned memory allocation functions are generally used for optimizing memory for MMX/SSE/SSE2 instruction usage. Although the standard size of a register is 32 bits (on 32 bit processors), not all registers are 32 bit sized. MMX registers are 64 bits wide and SSE registers are 128 bits wide. When moving, modifying or copying memory the operations are much faster when the data in memory is aligned on these boundries. Hope this helps.
Best Wishes,
-Randor (David Delaune)
|
|
|
|
|