|
Thanks for your reply. It's not that - I've found it:
VC6 used RichEdit 1.0 controls by default, whereas VS8 uses RichEdit 2.0 controls by default, so that is where the difference lies.
Version 1.0 seems to count line breaks as 2 chars, whereas 2.0 counts them as 1 char. I was getting my positions from my CString, which contains CR+LFs so counts line breaks as 2 chars.
I have changed my code to use the Find facility (EM_FINDTEXT/EM_FINDTEXTEX) in the RichEdit control, and all is now OK. (Not really sure why I didn't just use that in the first place!)
"The way of a fool seems right to him, but a wise man listens to advice" - Proverbs 12:15 (NIV)
|
|
|
|
|
Paul,
After I posted my reply I realized that I was responding incorrectly.
Anyway, I observed same "problem" - I was searching for string and not counting the space after the string. Consequently my display was off few characters. ( I was changing the text color)
By accident - and I am sure you are aware of that - if you search rich text control for string using substring search it will give you the first match and it may not be what you are looking for.
Cheers
Vaclav
|
|
|
|
|
Have you tried using EM_FINDTEXT to find the text position instead
of copying the text to a CString?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I have now! See my other reply.
Thanks.
"The way of a fool seems right to him, but a wise man listens to advice" - Proverbs 12:15 (NIV)
|
|
|
|
|
Hi there, i have written a dialog based aplication in vc++, my dialog contains some edit box and checkbox controlls that a user can write strings into or check the box's.
I am looking for a way to save the value of whether a box was checked or not so that if the program shutdown or the computer rebooted the program would remember settings when it was next restarted.
any suggestions would be much apriciated.
Chris
|
|
|
|
|
Then you have to save relevant (status) data to disk.
There are many ways to do the above, for instance, you can use the registry or (if there is a big amount of data) build your own files.
If you're using MFC, then have a look at serialization topic http://msdn2.microsoft.com/en-us/library/6bz744w8(VS.80).aspx[^].
BTW if you're already dealing with a database, then store data inside 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.
[my articles]
|
|
|
|
|
A simple solution would be to use a .inf file or the registry to store your information. If you choose to use .inf file, look into functions like GetPrivateProfileSection() , etc in Windows SDK. If you choose to use the registry, look into registry functions like RegSaveKeyEx() or look into the class CRegKey in ATL.
Do the sync stuff in InitDialog() .
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->ßRÅhmmÃ<-·´¯`·.
|
|
|
|
|
You can use of registry for save datas or xml files.
|
|
|
|
|
Can any one tell me how to increase the height of the statusbar
|
|
|
|
|
vethathiri wrote: ...the statusbar
Which one?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
His one!
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.
[my articles]
|
|
|
|
|
But I thought it was the other one. Man, no wonder I'm confused!
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
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.
[my articles]
|
|
|
|
|
There can only be one.
Wait...that's Highlander
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Maybe look in to overriding CStatusBar::CalcFixedLayout()
(see the MFC source for details) or use the SB_SETMINHEIGHT
message.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thank you
Now it is working fine
|
|
|
|
|
See SendMessage(m_hwndStatusBar,SB_SETMINHEIGHT,22,0);.
|
|
|
|
|
how to create a Windows Console Applications.
and does it mean.
|
|
|
|
|
Consoles Applications are character mode ones (like the command prompt), see
http://msdn2.microsoft.com/en-us/library/ms682055.aspx[^]
BTW often the standard C (or C++) Run-Time I/O library is used (instead of Console Functions) to provide I/O to such applications.
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.
[my articles]
|
|
|
|
|
File->New->Project->Win32->Win32 Console Application
|
|
|
|
|
dear all
#include <iostream>
using std::cout;
using std::endl;
void printArray(double [][4]);
int main()
{
double a[3][4] = {{0.3,0.4,0.5,0.6},{0.1,0.7,0.8,0.9},{0.11,0.12,0.13,0.14}};
printArray(a);
return 0;
}
void printArray(double a[][4])
{
for (int i = 1; i<=3; i++)
{
for (int j = 1; j j<=4; j++)
cout << a[i][j] << " ";
cout << endl;
}
}
why the result is changed in the end of one row?
thanks
Li Zhiyuan
4/01/2008
|
|
|
|
|
Hey man, C++ arrays (like C ones) are 0-based, for instance
int a[3];
a[0] = 5;
a[1] = 2;
a[2] = 4;
a[3] = 12
hence check your iteration limits.
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.
[my articles]
|
|
|
|
|
#include <iostream>
using std::cout;
using std::endl;
void printArray(double [][4]);
int main()
{
double a[3][4] = {{0.3,0.4,0.5,0.6},{0.1,0.7,0.8,0.9},{0.11,0.12,0.13,0.14}};
printArray(a);
return 0;
}
void printArray(double a[][4])
{
//Have the starting index as 0
for (int i = 0; i<3; i++)
{
for (int j = 0; j<4; j++)
cout << a[i][j] << " ";
cout << endl;
}
}
a[0][0] = 0.3
a[0][1] = 0.4
a[0][2] = 0.5
a[0][3] = 0.6
a[1][0] = 0.1
a[1][1] = 0.7
a[1][2] = 0.8
a[1][3] = 0.9
a[2][0] = 0.11
a[2][1] = 0.12
a[2][2] = 0.13
a[2][3] = 0.14
VIBIN
"Fool's run away,where angle's fear to tread"
|
|
|
|
|
Hi all,
can I create deep folder hierarchy which is exceeding 260 characters on windows 2003 server?
Is there any way to do this?
|
|
|
|
|
vikrams wrote: can I create deep folder hierarchy which is exceeding 260 characters...
260 characters for the whole path, or just one of the folders in the path? Have you looked at SHCreateDirectoryEx() ?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|