|
Then it would not be possible for the user to enter anything in the rich edit control through the keyboard if it's a control with Read Only Property set to true.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
_AnShUmAn_ wrote: Then it would not be possible for the user to enter anything in the rich edit control through the keyboard if it's a control with Read Only Property set to true.
While johnalek's suggestion had nothing to do with the OP's question, an edit control whose Read-Only property is set to False means it can be interacted with via the keyboard.
"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
|
|
|
|
|
ReadOnly or Number!?
|
|
|
|
|
Probably you need something like this:
void CMyDlgDlg::OnEnChangeRichedit21()
{
CString str;
m_richedit.GetWindowText (str);
bool flag = false;
for ( int i = 0 ; i < str.GetLength () ; i++)
{
if(str.GetAt (i) >= '0' && str.GetAt (i) <= '9')
{
flag = true;
}
else
{
m_richedit.SetWindowText (lastCorrectText);
flag = false;
break;
}
}
if(flag)
lastCorrectText = str.Left(i+1);
m_richedit.SetSel(-1,-1);
}
Optimize the code for ur use now. I haven't tested it but hope that it works
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
|
It seems you set Number style for RichEdit of property window or with code?
|
|
|
|
|
Setting the ESNUMBER style is a great solution, but (at least it happens in the CEdit) then you won't be able to use floating point values like 12.3 or 12,3.
If you need to use floating point values the only thing I can think of is to extend the RicheditControl implementing a new class and implement a filter like _AnShUmAn_ has told you.
Hope this helps.
Best regards,
|
|
|
|
|
Hi
iam doing Chat application with out language pack installation .In this when i paste chinese characters in rtf .
And sending from rtf to Html chinese characters r converting pair of 8-bit codepoints. i need help how to convert pair of 8-bit codepoints to decimal value ...plz tell...
#sanroop#
|
|
|
|
|
Does it mean that you need to convert a byte pair to an int?
you can do this the following way
BYTE byte[N];
int k;
...
int i = byte[2*k] + byte[2*k+1] * 256;
or
where <code>k</code> is the pair number.
...
int i = byte[2*k+1] + byte[2*k] * 256;
depending on encoding 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.
[my articles]
|
|
|
|
|
class Exception{};
//warning C4290: C++ Exception Specification ignored
void ExceptionSepcification()throw(Exception)
{
throw Exception();
}
void WithOutExceptionSepcification()
{
throw Exception();
}
void main()
{
try
{
ExceptionSepcification();
//Or call
WithOutExceptionSepcification();
}
catch(Exception& e)
{
cout<<"Exception caught";
}
}
Both the Function ExceptionSepcification and WithOutExceptionSepcification throws Exception.
The what does the throw in Below statement makes difference
void ExceptionSepcification()throw(Exception)
VIBIN
"Fool's run away,where angle's fear to tread"
|
|
|
|
|
Essentially it's just a hint to the Compiler bu the exact answer is both Compiler and Compiler Option Switch dependent. See MSDN[^] for an explanation of Microsoft's attempts at C++ Exception support.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
|
Hi,
can somebody tell me how to get the handle of edit box of a combobox in win32 environment.
Thanks
|
|
|
|
|
|
|
Thanks to both of you. My problem is solved now, after using the above mentioned function.
|
|
|
|
|
Hi all,
So far, I have had several projects in which I have used Office automation. Although this is always a pain in the #@# due to the lack of proper documentation, I have so far always succeeded. Now, I am trying the same thing, using office 2007. In itself, this looks a lot the same, but Microsoft wouldn't be Microsoft if they hadn't changed a few things here and there! Where for example the _Application used to have a GetWorkbooks method (I am now talking about excel automation), the _Application has been changed to Application, and it no longer has a GetWorkbooks method. In turn, it now has the "Workbooks" item. This item returns a VARIANT, rather than an LPDISPATH, which means that - when compiling - I get the error "no operator defined which takes a right-hand operand of type 'struct tagVARIANT'" when I use the code:
Application Excel;
Workbooks Collection;
COleVariant vOpt....;
Collection = Excel.Workbooks (vOpt);
How do I go about this? Does anyone have any suggestions? The Microsoft "documentation" of course remains silent on the subject (or at least, I have not been able to find any usefull information)
Thanks in advance,
William
|
|
|
|
|
William Engberts wrote: The Microsoft "documentation" of course remains silent on the subject
What documentation? Provide a link to the documentation you are referencing.
|
|
|
|
|
Hello All,
I want to use ffmpeg for creating FLV file in my Application.
Anybody know how to use ffmpeg library in win32 project?
Thanks in advance.
Manish Patel.
B.E. - Information Technology.
|
|
|
|
|
Hello everyone,
I think unmanaged resource means the resources (e.g. memory and file handler) which is used directly (new, FILE*) other than using a wrapper class (Resource Acquisition Is Initialization) or auto_ptr to wrap it. Is my understanding correct?
Here is a sample about what is unmanaged resource.
--------------------
http://www.gotw.ca/gotw/066.htm
Moral #3: Always perform unmanaged resource acquisition in the constructor body, never in initializer lists. In other words, either use "resource acquisition is initialization" (thereby avoiding unmanaged resources entirely) or else perform the resource acquisition in the constructor body.
--------------------
thanks in advance,
George
|
|
|
|
|
Yes, I think that's pretty much the idea.
Basically, in this context, 'unmanaged' means anything that is not destroyed/deallocated/uninitialized automatically.
In Microsoft parlançe, though, 'unmanaged' means native code, as opposed to native code. (At least that's how I understood it.)
Florin Crisan
|
|
|
|
|
George_George wrote: (thereby avoiding unmanaged resources entirely)
That is an unfortunate use of the word "unmanaged". RAII is about managing resources. This is the first person I have ever seen use the word "unmanaged" in reference to "managing resources".
The author seems to be using "unmanaged" to reference code that does not implement RAII. It seems to me that the usage is incorrect because you are always managing a resource even if you do not use an RAII approach. IMHO the word has been used improperly.
[Modification]
Ummm ok. The author is Herb Sutter so I think he can say whatever he likes. "unmanaged" is fine by me.
modified on Wednesday, January 02, 2008 3:07:20 PM
|
|
|
|
|
Hi,
I couldn't find a way to capture the events fired by the "Back" and "Forward" buttons on the mouse. I thought this would be a standard behavior by CHtmlView and should be handled automatically, but it's not.
Is there a sample somewhere I can look at?
Thanks.
|
|
|
|
|
Hello everyone,
Through myself study and previous discussion here, I share the conclusion here that,
if some object is synchronized (mutex, critical section, etc.), there is no need to add volatile keyword.
Here is the reference,
(refer to section volatile, Critical Sections, and Race Conditions)
http://www.ddj.com/cpp/184403766
if my understanding is wrong or you have any other options, please feel free to add here.
thanks in advance,
George
|
|
|
|
|
Hey George, let me understand what's your issue against the volatile keyword: Did your lineage be victim of a strange anathema?
By the way, you missed to mention (if I remember well was David Crow to point it out) that main usage of volatile is not synchronization.
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]
|
|
|
|