|
Well I think its best time to modify it now!
|
|
|
|
|
Hamid. wrote: Well I think its best time to modify it now!
Hi..
See i am reading certain mails i want to sort them by mailDate in Decresing order...and write into xml..
Now i am reading the mail as it is and writing into xml file...
how i can compare it and write so it will be in ascending order..
My code is..
///////////////////
for(int y=0; y<(linfo->ACL_STMAIL[0].iMBUserMailCount); y++)
{
mailDatee = linfo->ACL_STMAIL[y].cMBUserMailDate;
mailDatee.Remove('/');
{
elementName [0] = "NAME";
elementValue[0] = linfo->ACL_STMAIL[y].cMBUserMailFromName;
elementName [1] = "EMAIl";
elementValue[1] = linfo->ACL_STMAIL[y].cMBUserMailFromEmail;
elementName [2] = "DATE";
elementValue[2] = mailDatee;
elementName [3] = "TITLE";
elementValue[3] = linfo->ACL_STMAIL[y].cMBUserMailSubject;
elementName [4] = "BODY";
elementValue[4] = linfo->ACL_STMAIL[y].cMBUserMailTextDesc;
}
Here mailDatee are the maildate i get from mails one by one
thank you
Hi..
I am Mnaju.I have Completed my B.E Computers Science.Lokking for a job.I am interested in VC++
manju
|
|
|
|
|
What type of a variable is mailDatee?
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Rajesh R Subramanian wrote: What type of a variable is mailDatee?
CString mailDatee;
Hi..
I am Mnaju.I have Completed my B.E Computers Science.Lokking for a job.I am interested in VC++
manju
|
|
|
|
|
Why is a date being stored as a string?
OK - what is linfo ?
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Rajesh R Subramanian wrote: OK - what is linfo?
linfo->ACL_STMAIL[0].iMBUserMailCount is nothing but
It gets the mail Count..How many mails are there
linfo is a nested structure
Rajesh R Subramanian wrote: Why is a date being stored as a string?
Because first i was getting date in yyyy/mm/dd..
So to remove "/" I converted it to CString..
Hi..
I am Mnaju.I have Completed my B.E Computers Science.Lokking for a job.I am interested in VC++
manju
|
|
|
|
|
manju#123 wrote: linfo is a nested structure
Can you show me how the structure looks like?
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Rajesh R Subramanian wrote: Can you show me how the structure looks like?
//////////////////
struct loginInfo<br />
{<br />
CAclsApi *TestApi ;<br />
_TCHAR *sUserName;<br />
_TCHAR *sPassWord;<br />
_TCHAR *sServerName;<br />
_TCHAR *sTagStyle;<br />
long sMaxCrawl;<br />
const _TCHAR *sStDate;<br />
const _TCHAR *sEndDate;<br />
_TCHAR *sFileExt;<br />
_TCHAR *OutPut;<br />
_TCHAR *sMailDate;<br />
_TCHAR *sDuration;<br />
bool *cMailHasAttachment;<br />
_TCHAR *cAttachFileNames;<br />
bool bThreadRunning;<br />
bool bServerConnected;<br />
bool BServerConnected() const { return bServerConnected; }<br />
void BServerConnected(bool val) { bServerConnected = val; }<br />
bool btimeOut;<br />
_TCHAR thstrAclInfo[1024];<br />
ACL_STATUS status;<br />
ACL_STRUCT_INFO *ACL_INFO;<br />
ACL_STRUCT_MBUSERS_MAIL *ACL_STMAIL; <br />
ACL_STRUCT_MBUSERS *ACL_MBUSERS;<br />
ACL_STRUCT_MBUSERS_MAIL_ATTCH *ACL_MAIL_ATTACH;<br />
<br />
};
unsigned int __stdcall ConnectToServer(void *dummy)<br />
{<br />
loginInfo *linfo = (loginInfo*)dummy; <br />
linfo->ACL_INFO=new ACL_STRUCT_INFO;<br />
linfo->ACL_STMAIL=new ACL_STRUCT_MBUSERS_MAIL[MAX_MAIL_COUNT];<br />
linfo->ACL_MBUSERS=new ACL_STRUCT_MBUSERS[MAX_MAILBOX_COUNT];
Hi..
I am Mnaju.I have Completed my B.E Computers Science.Lokking for a job.I am interested in VC++
manju
|
|
|
|
|
I asked you for linfo and you've provided me with loginInfo structure. Follow these steps:
1. Find out how this linfo structure is being populated. Somewhere, a COleDateTime should be in place, hopefully.
2. You could compare COleDateTime variables to find out which is greater, just like you compare integers. This is because the COleDateTime class has the relational operators defined.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Hi everyone!
My problem:
- I've got two programs
- both programs are located in the same directory
- each one writes data to a file named "c:\prog\bin\protocol.log"
- the file "protocol.log" get's corrupt
My question:
Is it possible to change the environment of one program so that it writes to another location?
|
|
|
|
|
Why dont you give the protocols different names? (log"Process ID".log)
You better write the logs in a user directorcy, are you get trouble on Vista.
Greetings from Germany
|
|
|
|
|
Do you have source code of these programs?
|
|
|
|
|
No I haven't. Otherwise there won't be a problem!
|
|
|
|
|
Yes it is possible to modify the environment and/or hook NtOpenFile. But there are probably better solutions which should be tested first.
If the program is writing to its 'working' directory: Have you tried creating a shortcut to the executable and modifying the "Start In" directory?
Best Wishes,
-David Delaune
|
|
|
|
|
Ah cool! Thanks for your advice!
I found what I'm looking for: www.codeproject.com/KB/system/soviet_protector.aspx
|
|
|
|
|
Hi all.
See i am reading certain mails i want to sort them by mailDate in Decresing order...and write into xml..
Now i am reading the mail as it is and writing into xml file...
how i can compare it and write so it will be in ascending order..
for(int y=0; y<(linfo->ACL_STMAIL[0].iMBUserMailCount); y++)
{
_tprintf("\nMails found between %s date and %s date\n",linfo->sStDate,linfo->sEndDate);
mailDatee = linfo->ACL_STMAIL[y].cMBUserMailDate;
mailDatee.Remove('/');
if(linfo->ACL_STMAIL[y].bMBUserMailHasAttachment)
{
AttachCount=linfo->ACL_STMAIL[y].iMBUserMailAttachFileCount;
for(int i = 0;i < (linfo->ACL_STMAIL[y].iMBUserMailAttachFileCount); i++)
{
elementName [0] = "NAME";
elementValue[0] = linfo->ACL_STMAIL[y].cMBUserMailFromName;
elementName [1] = "EMAIl";
elementValue[1] = linfo->ACL_STMAIL[y].cMBUserMailFromEmail;
elementName [2] = "DATE";
elementValue[2] = mailDatee;
elementName [3] = "TITLE";
elementValue[3] = linfo->ACL_STMAIL[y].cMBUserMailSubject;
elementName [4] = "BODY";
elementValue[4] = linfo->ACL_STMAIL[y].cMBUserMailTextDesc;
Hi..
I am Mnaju.I have Completed my B.E Computers Science.Lokking for a job.I am interested in VC++
manju
|
|
|
|
|
Hi..
I am having the date in format..
20080430 8:36:05 and 20080423 13:49:19
I want to compare which is greater...any suggestion..
thank you
manju..
Hi..
I am Mnaju.I have Completed my B.E Computers Science.Lokking for a job.I am interested in VC++
manju
|
|
|
|
|
Well, if you are using COleDateTime, you could use the relational operators ( == , != , < , > , etc.,) [^] of that class. The linked page has an example too.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
|
if the format is always fixed (i.e. there must be two spaces between 20080430 and 8:36:05 in your sample string) then a lexicographic comparison is enough, that means strcmp will do the magic:
const char * date1 = "20080430 8:36:05";
const char * date2 = "20080423 13:49:19";
int icmp = strcmp(date1,date2);
if ( icmp > 0)
{
}
else if ( icmp < 0 )
{
}
else
{
}
On the other hand. If the format is not fixed then you're a (actually not so much: it is fairly easy to repair it) unlucky girl.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I want to set font of caption of static text control (lebel) in ATL.
|
|
|
|
|
You posted this question yesterday at two different forums and now, again. What's wrong with the answers you got? Reposting/Crossposting is rude and will get you ignored in no time.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Sorry, But i am not getting the proper answer and this is the last time i am doing.
|
|
|
|
|
|