|
i am not sure for this. i tried many times, still couldn't finish it. do you have any other idea, thanks
gentleguy
|
|
|
|
|
Hi all..
I am storing some mails in XML Format...Now i want to Sort them and store in XML File by MailDate wise...
My mail dates are
///////////////////////////////
CString mailDate;
////////////////////////////
I am getting date in this format..
20080430 8:36:05
20080423 13:49:19
20080402 14:56:50
20080402 14:21:11........
How i Can Compare and Sort them...
plz give me some idea
Thanking you
manju
Hi..
I am Mnaju.I have Completed my B.E Computers Science.Lokking for a job.I am interested in VC++
manju
|
|
|
|
|
I offered you a suggestion previously on this issue. What happened to that? Why is a date stored as a string in your program? If you have it as a COleDateTime object, you could use the COleDateTime Relational Operators[^].
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Actually We are reading from the mails and storing as a "CHAR" in Structure..
<br />
typedef struct {<br />
<br />
LONG iMBUserMailBoxSize;<br />
LONG iMBUserMailCount;<br />
LONG iMBUserMailSize;<br />
LONG iMBUserMailAttachFileCount;<br />
BOOL bMBUserMailHasAttachment; <br />
TCHAR cMBUserMailPath[MAX_PATH_LEN];<br />
TCHAR cMBUserMailFrom[MAX_PATH_LEN];<br />
TCHAR cMBUserMailFromEmail[MAX_PATH_LEN];<br />
TCHAR cMBUserMailFromName[MAX_PATH_LEN];<br />
TCHAR cMBUserMailBcc[MAX_PATH_LEN];<br />
TCHAR cMBUserMailCc[MAX_PATH_LEN];<br />
TCHAR cMBUserMailDate[MAX_DATE_LEN]; <br />
TCHAR cMBUserMailSubject[MAX_PATH_LEN];<br />
TCHAR cMBUserMailTextDesc[MAX_MAIL_SIZE];<br />
ACL_STRUCT_MBUSERS_MAIL_ATTCH ACL_ATTACH[MAX_ATTACH_COUNT];<br />
<br />
} ACL_STRUCT_MBUSERS_MAIL;
First we get a MailDate it is in "TCHAR"......
After that we changed it to CString to Remove "/" operator....thats it..
manju
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: Actually We are reading from the mails and storing as a "CHAR" in Structure..
Don't store it as a char, store it as a COleDateTime. That's all I have to offer.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Rajesh R Subramanian wrote: store it as a COleDateTime.
Ok i will change it COleDateTime...
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
|
|
|
|
|
Rajesh R Subramanian wrote: store it as a COleDateTime.
Ok i will change it as COleDateTime...
Thank you for your suggestion
manju
Hi..
I am Mnaju.I have Completed my B.E Computers Science.Lokking for a job.I am interested in VC++
manju
|
|
|
|
|
One more thing..
If MailDate is in CString...We can Sort it or not..
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
|
|
|
|
|
manju#123 wrote: If MailDate is in CString...We can Sort it or not..
If you have it as a COleDateTime object, the job would be easier for you as the relational operators are defined for that class. Doing it with a CString will be known as a "Coding horror".
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Thank you.
I will change Char to COleDateTime and Check it...
manju
Hi..
I am Mnaju.I have Completed my B.E Computers Science.Lokking for a job.I am interested in VC++
manju
|
|
|
|
|
i am displying the integers in edit box by using SetDlgItemInt the output is overwritten but i want to display it in multiple lines like a sequence....plz n e budy help me out!!!!
|
|
|
|
|
Not sure which of your questions to reply to... This one, or the one from one minute earlier... I'll assume it was some sort of error.
There is a edit box style to allow it to have multiple lines, but that would require you to get the text, add a carriage return and the new number, then set the text. Very inefficient.
Instead, I would recommend a list box, with the sort style turned off. Then you can just add a new string / number to the end, and let windows do the hard work.
eg:
void CMyDlg::AddNumberToListBox (int nValue)
{
CListBox *lb = (CListBox *)GetDlgItem (IDC_MYLISTBOX);
CString s;
s.Format ("%i", nValue);
int nSel = lb->AddString (s);
if (nSel != LB_ERR)
lb->SetCurSel (nSel);
}
Good luck,
Iain.
Plz sir... CPallini CPallini abuz drugz, plz plz help urgent.
|
|
|
|
|
i am displying the integers in edit box by using SetDlgItemInt the output is overwritten but i want to display it in multiple lines like a sequence....plz n e budy help me out!!!!
|
|
|
|
|
I guess you didn't check the multiline property of the edit box to true in properties. Also set the "want return" property to true if you want that on pressing enter key the caret should move to the next line,
Also do remember, every time you set a new value to the edit box you need to take the existing values, append new value to it and then display it.
BTW why don't you use a LISTBOX
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
thanx a lot, i m gona try it.... the reason not to use listBox is that it only takes string values, but i need to show integers
|
|
|
|
|
You just have to use a single line of code to convert an integer to a string. or use SetItemData[Listbox]. It's that simple
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
modified on Thursday, June 26, 2008 4:56 AM
|
|
|
|
|
Instead of textbox why dont you try listbox.
And if you have no choice then as anshuman said set all those properties
plus you cant use SetDlgItemInt in this case.
You have to take the string using GetWindowText(..) everytime you want to update then append the new string to it and call SetWindowText(..) again.
I hope it helps..
Regards,
Sandip.
|
|
|
|
|
thnx...i m not using listBOx coz it only deals with the string values...but i have to show integers as a result
|
|
|
|
|
Then in that case what you are trying with editbox can be implemented using strings only.
so as anshuman has already suggested using SetItemData with ListBox is good option.
Regards,
Sandip.
|
|
|
|
|
Can you convert intger to string and use of \n for editbox?
|
|
|
|
|
Hi all,
Just a simple question really, here is what I need to do I will open a key lets say the key is
Result = RegOpenKeyEx(HKEY_LOCAL_MACHINE, _("MainProgram1"), REG_OPTION_NON_VOLATILE,
KEY_ALL_ACCESS,&Regentry);
Then here is the part I am a bit confused, In MainProgram1 there are values such as ProgramVersion1, ProgramVersion2....-> Nth value. Now how can I automatically get the Data of each name and I also need to get the names of the values. I need to get if there is a ProgramVersion2 or something. Thing is the names are all ProgramVersion only the version number changes. Any ideas folks?
Thanks,
Jayjay
|
|
|
|
|
After opening the key with RegOpenKeyEx you can use
LONG RegEnumKeyEx(
HKEY hKey,
DWORD dwIndex,
LPTSTR lpName,
LPDWORD lpcName,
LPDWORD lpReserved,
LPTSTR lpClass,
LPDWORD lpcClass,
PFILETIME lpftLastWriteTime
);
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
See here [^] for sample code.
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]
|
|
|
|
|
|
Hi all,
How can Enable and Disable Menu item in SDI type application of MFC-VC++2005.There is Enable and disable propery is present in Menu Properties but i dont want to use it because it is manully enable and disable menu item.
i want to enable and disable requried menu item with using of function.
Please help me for this how can i do this.
Thanks in advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|