|
Hi,
Yeah if I define as multiline it is working.
But it is working only if I give manually like
SetWindowText("red\r\nblue\r\ngreen");
But if i get the data from external source via UART I am collecting in a buffer.
Buffer contains the chars 10,13 after each word.
Then I directly do SetWindowText(buffer);In that case it is displaying in a single line,
not in multilines.
So what should be done if I have to display the data in multilines whenever i come across 10,13 characters.
Please help!
Regards,
Sunil Kumar
|
|
|
|
|
Replace 10 with \r and 13 with \n ?
|
|
|
|
|
Hi Rajesh,
Is there any difference between 10 and '\r' , 13 and '\n'.
I think they are ascii euqivalents only na??
In the buffer if I replace 10 with '\r', in the debug mode I am able to see 10 only as it is the ascii
euivalent.
Regards,
Sunil Kumar
|
|
|
|
|
So, that was the reason why I asked you for the code. Also, I'd like to see how this 10 and 13 are coming within a string. It is impossible to tell you anything without looking at your code.
|
|
|
|
|
sunilkumar.d wrote: Is there any difference between 10 and '\r' , 13 and '\n'.
Yes.
sunilkumar.d wrote: I think they are ascii euqivalents only na??
You're wrong:
10 is the ASCII code for '\n'
13 is the ASCII code for '\r' .
(i.e. you're getting the characters in the reverse order).
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]
|
|
|
|
|
My first thought was "Hmph, of course it works..."
But I thought I'd get some evidence before acting all superior.
This does not work:
CString buf;
buf += "Hello";
buf += char (10);
buf += "There";
SetDlgItemText (IDC_EDIT7, buf);
This does not work:
CString buf;
buf += "Hello";
buf += char (13);
buf += "There";
SetDlgItemText (IDC_EDIT7, buf);
This does not work:
CString buf;
buf += "Hello";
buf += char (10);
buf += char (13);
buf += "There";
SetDlgItemText (IDC_EDIT7, buf);
This works!
CString buf;
buf += "Hello";
buf += char (13);
buf += char (10);
buf += "There";
SetDlgItemText (IDC_EDIT7, buf);
Which comes as a bit of a surprise to me... Needing both CR and LF is no shock, but which order? Quite a surprise.
How you solve it is up to you really. Your reading from the UART routine could simply swap char(10) with char(13) and vice versa.
Or your routine that puts the text into the screen could.
You could put it in a string, and do a replace like so:
while (1)
{
int nFind = MyString.Find ("\n\r");
if (nFind < 0) break;
MyString [nFind] = '\r';
MyString [nFind+1] = '\n';
}
The choices are (near) endless.
Iain.
|
|
|
|
|
Yeah Iain,
It is a bit surprise.
If I change the order , like if 10 is replaced with '\r' and 13 is replaced
with '\n', it is displaying in multilines.
Regards,
Sunil Kumar
|
|
|
|
|
Hi all,
i have to access file those extension are .mdb, how can i write data from one .mdb file to another,thru coding.
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
|
|
|
|
|
"_$h@nky_" wrote: how can i write data from one .mdb file to another,thru coding
you mean, pure file copy ?
or you want to copy internal parts of it only ?
if so, you must know the format of the file first...
|
|
|
|
|
No i have already done file copying.
In file copying the exist data is removed.
So i want write data from source file to dest file,without losting of existing data of dest file.
So please tell me how can i do this ?
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
"_$h@nky_" wrote: In file copying the exist data is removed.
Who removed it?
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 mean the dest file is replaced by source file in file copying,
and existing data of dest file is lost.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
Hence you don't need a copy: you need to add the whole content of a database to another, not-empty, one. I think you should do it without bypassing the database engine (i.e. you have to use SQL or an Access tool).
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]
|
|
|
|
|
Please tell me how can i do this from SQL command.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
I think the best approach is
Search for an Access import/export tool and then use it.
If you cannot exploit the above then use SQL , but it won't be a painless task, I presume.
[added]
"_$h@nky_" wrote: IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
It looks like you're travelling in the right path today.
[/added]
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]
modified on Thursday, July 31, 2008 8:17 AM
|
|
|
|
|
"_$h@nky_" wrote: So i want write data from source file to dest file,without losting of existing data of dest file
wait, isn't that a copy for you (a copy of data) ???
you take the entiere source file content, and you write it entierely into the destination file as is. right ?
|
|
|
|
|
Yes
toxcct wrote: take the entiere source file content, and you write it entierely into the destination file
i want to copy all data of souce file in dest file,without losting existing like.
like appending.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
ah, you want to append the source file to the dest one.
hum, I could always propose the bare solution, which will copy the data like needed, but i'm not sure the destination mdb will be still valid afterward.
is it a binary file of a text file ?
and do you know the structure of the file (how the data are set inside the file) ??
oh and by the way, where are those .mdb file coming from ?
|
|
|
|
|
sir,
In my application i m using access database so i use .mdb file,
in case of restoration i want copy of old data of old file into new file with new data.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
Since it's just an Access file, use the ODBC driver. Derive a class from CRecordset .
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
this is wat i tried..dint work
void CMenuDlg::OnOK()
{
CDisplayDlg dlg;
UpdateData();
dlg.m_List.AddString(m_name);
dlg.m_List.AddString(m_dept);
UpdateData(FALSE);
CDialog::OnOK();
}
modified on Thursday, July 31, 2008 3:43 AM
|
|
|
|
|
Hi, the post title should be meaningful, did you read posting guidelines?
BTW:Kausalya Srinivasan wrote: void CMenuDlg::OnOK()
{
UpdateData();
CDisplayDlg dlg;
dlg.m_List.AddString(m_name);
dlg.m_List.AddString(m_dept);
UpdateData(FALSE);
}
The above is not the way to go.
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]
|
|
|
|
|
then how do u do it...without using files
|
|
|
|
|
man, you've been on this forum for few hours only, and still you don't listen to the advices people gave you...
modified on Thursday, July 31, 2008 3:43 AM
|
|
|
|
|
hi,
as CPallini stated, please first read the Posting Guidelines[^].
then edit (not repost) your message consequently.
now, a question.
why are you declaring dlg (which is not even initialized) ?
is the list you want to add items into located in another dialog ?
if it's not, just replace dlg by this (or remove it, it will be implicit). otherwise, you have to rethink your technical design. things cannot be done like this.
|
|
|
|