|
Try using something like that:
std::wstring str = L"Special letters: \u0985";
MessageBox(NULL,str.c_str(),L"Caption",MB_OK);
Life is a stage and we are all actors!
|
|
|
|
|
Almost
std::wstring str = L"Special letters: \x0985";
MessageBox(NULL,str.c_str(),L"Caption",MB_OK);
|
|
|
|
|
Is there any difference between \x20AC and \u20AC for example ?
Characters size or code page issues or other?
I've thought they display exactly the same and wcscmp confirmed that produced strings are identical.
Life is a stage and we are all actors!
|
|
|
|
|
Hristo Bojilov wrote: Is there any difference between \x20AC and \u20AC for example ?
The former is a character escape for a hex number - the later is not a valid C/C++ escape character[^].
[EDIT] But MS VC++ happily compiled it - apparently, a MS-specific extension [^]: "If a backslash precedes a character that does not appear in the table, the compiler handles the undefined character as the character itself. For example, \c is treated as an c."
Funny
[/EDIT]
modified on Monday, October 26, 2009 11:34 AM
|
|
|
|
|
Nemanja Trifunovic wrote: But MS VC++ happily compiled it...
I got C4129 from VS6.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
DavidCrow wrote: I got C4129 from VS6
So we found a case where VC6 is more standard-compliant than VC10 Beta 2
|
|
|
|
|
What do you know? I just found out about Universal character names[^]. They are not escape sequences, but can be used to enter various international characters.
|
|
|
|
|
OK.Thanks for your feedback.
My best regards.
[EDIT]
I wondered why I used \u but I've discovered that it's C# equivalent [^] of the C++ syntax i.e C# routine.
Life is a stage and we are all actors!
modified on Monday, October 26, 2009 2:58 PM
|
|
|
|
|
Shaheen.India wrote: wcscpy(strUnicode[0],L"U+0985");
Should be
wcscpy(strUnicode[0],L"\x0985");
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]
|
|
|
|
|
|
hello,
I have used ModifyStyle to modify the style of a window from readonly to noreadonly but it doesnt reflect in the window.
CRichEditCtrl m_Table;
m_Table->ModifyStyle(ES_READONLY,0,SWP_NOSIZE);
Wht must be the problem
|
|
|
|
|
some styles cant be modified at runtime. In that case you got to destroy the window and create another in its place. I sometimes use 2 windows for that case (only one visible)
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
Try this:
SendMessage(hwnd,EM_SETREADONLY,1,0); // set readonly flag
SendMessage(hwnd,EM_SETREADONLY,0,0); // remove readonly flag
|
|
|
|
|
Have you used Spy++ to very the styles before/after the call to ModifyStyle() ? Have you tried using SetReadOnly(FALSE) method?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
prithaa wrote: CRichEditCtrl m_Table;
m_Table->ModifyStyle(ES_READONLY,0,SWP_NOSIZE);
This wont work as you have not got the Dialog item for your edit control ..
If you have an MFC application in the pretranslateMessage() or OnInitdialog() or where ever you want to introduce new property to the control :
GetDlgItem(Your RichEditControl's ID for eg.IDC_RICHEDIT_CTRL)->ModifyStyleEx(ES_READONLY,0,SWP_NOSIZE);
Invalidate();
If this answer helps Mark it as GOOD answer.
Regards,
Kushagra
|
|
|
|
|
Hey Guys,
I am in need of a method to keep my rectangle frame, drawn with OnMouseMove() and OnDraw() with coords specified from OnLButtonUp() and OnLButtonDown(), on the top of an image that is being updated with and OnTimer() function every some odd milliseconds. Here are a few code snippets:
Drawing the framerect:
void LiveFeed::OnMouseMove(UINT nFlags, CPoint point)
{
if (GetCapture() == this)
{
m_ptEnd = point;
Invalidate();
}
CRect r(m_ptStart, m_ptEnd);
CPaintDC dc(this);
dc.GetSafeHdc();
dc.FrameRect(&r,0);
}
void LiveFeed::OnDraw(CDC* pDC)
{
CRect r(m_ptStart, m_ptEnd);
pDC->FrameRect(&r,0);
}
Updating the image with OnTimer() The BlitX function just transfers an image to the specified window from a camera:
void LiveFeed::OnTimer(UINT nIDEvent)
{
XC_BlitX(cam->GetHandle(), m_hWnd, 0, 0, 640, 512, Window);
}
This setup causes my FrameRect to be drawn but then it gets covered by my image being updated. I need a way to draw on top of a refreshing image. I think I may need to use some sort of graphic control, but I am really unsure where to start to tackle this problem!
Any help would be appreciated and thanks in advance for taking the time to read my post!
-esc321
|
|
|
|
|
You should put all of your drawing stuff inside the OnDraw message handler. OnMouseMove and OnTimer should only change the state of your class and then notify the area should be updated (so that OnDraw will be called).
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]
|
|
|
|
|
what about an underestimated call of Invalidate() ?
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
That's contemplated in 'notify the area should be updated'
It is a logical step, implementation details left as exercise.
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]
|
|
|
|
|
Ah, i think I understand. If I move my image update function to OnDraw() it should keep everything on the same "Timer". If I try this, how do I get OnDraw() to be called? The timer?
|
|
|
|
|
When you need a re-paint to occur (and hence a call to OnDraw happen) you've to code the sequence
InvalidateRect(NULL);
UpdateWindow();
Please read the related documentation [^], [^].
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]
|
|
|
|
|
|
Iain Clarke, Warrior Programmer wrote: Heh - I should refresh more often...
I suggest you InvalidateRect /UpdateWindow , for the purpose...
Iain Clarke, Warrior Programmer wrote: Great minds think alike:
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]
|
|
|
|
|
You need to do a bit of reading of windows stuff.
The OnDraw method is called from the OnPaint hander. That wraps WM_PAINT for you.
To make windows issue a WM_PAINT when next convenient, use InvalidateRect function.
Lastly, to force an update, use the UpdateWindow function.
If you search for those functions on msdn, hopefully how windows works will become clearer.
Iain.
I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need contract work done, give me a job! http://cv.imcsoft.co.uk/[ ^]
|
|
|
|
|
Ok. I have tried using Invlaidate and UpdateWindow to get a message to prompt the OnDraw function to no avail. I have added these to my OnInitDialog and to the OnTimer functions. If there is nothing drawn to begin with do these functions still work? Thanks to everyone for their timely responses.
|
|
|
|