|
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#
|
|
|
|
|
You post the same yesterday. I already answered asking you for more details. Could you please be so kind to elaborate a bit?
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]
|
|
|
|
|
I'm trying to restrict my dialog window from being moved outside the visible screen area.
I'm doing this using this method:
void CWindowsDVRDlg::OnWindowPosChanged(WINDOWPOS FAR* lpwndpos)
{
CSkinDialog::OnWindowPosChanged(lpwndpos);
CRect rc;
GetWindowRect (&rc);
if (EnsureRectangleOnDisplay(rc)){
SetWindowPos(NULL, rc.left, rc.top, 0,0, SWP_NOSIZE | SWP_NOZORDER);
}
else{
SendMessage(DM_REPOSITION);
}
RedrawWindow(NULL,NULL,RDW_INVALIDATE);
}
The code works but its flaw is that it's still painting the dialog window outside the visible screen area just before it is repositioned inside the screen (by SendMessage(DM_REPOSITION)). Flickering is the result of this.
Can anyone help me with this? You're help would be much appreciated.
|
|
|
|
|
Use OnWindowPosChanging instead.
|
|
|
|
|
Thanx!
I tried using OnWindowPosChanging() beforehand but the problem is, it seems it cannot process the SendMessage(DM_REPOSITION) at all which is what I need to implement.
Any other ideas on preventing the program from painting windows outside the screen (results in flickering) while using OnWindowPosChanged() and SendMessage(DM_REPOSITION)?
|
|
|
|
|
You can stop painting in the OnPaint method.
Or (better) you can invalidate (if it is under your control) only the inside-screen area.
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]
|
|
|
|
|
demxine wrote: Any other ideas on preventing the program from painting windows outside the screen (results in flickering) while using OnWindowPosChanged() and SendMessage(DM_REPOSITION)?
I dont understand the need of this... If you are targeting to restrict the window movement, OnWindowPosChanging is enough. You only need to update the WINDOWPOS structure values passed by it. No need of DM_REPOSITION.
Is my understanding correct?
|
|
|
|
|
Can you post a specific piece of code on how to do this:
(If you are targeting to restrict the window movement, OnWindowPosChanging is enough. You only need to update the WINDOWPOS structure values passed by it. No need of DM_REPOSITION)
Actually, I have no idea how to make it work other than using SendMessage(DM_REPOSITION)in restricting window movement only to the visible screen. Could you help me please.
|
|
|
|
|
Sorry for the delay...
demxine wrote: Can you post a specific piece of code on how to do this:
Try this...
void CDlgTestDlg::OnWindowPosChanging(WINDOWPOS FAR* lpwndpos)
{
CDialog::OnWindowPosChanging(lpwndpos);
if( lpwndpos->x < 0 ) lpwndpos->x = 0;
if( lpwndpos->y < 0 ) lpwndpos->y = 0;
int nScrW = GetSystemMetrics( SM_CXMAXIMIZED );
int nScrH = GetSystemMetrics( SM_CYMAXIMIZED );
if(( lpwndpos->x + lpwndpos->cx ) > nScrW ) lpwndpos->x = nScrW - lpwndpos->cx;
if(( lpwndpos->y + lpwndpos->cy ) > nScrH ) lpwndpos->y = nScrH - lpwndpos->cy;
}
|
|
|
|
|
Hey, it works! Thank you so much for your help. Cheers! ^_^
|
|
|
|
|
demxine wrote: Thank you so much
You are welcome...
|
|
|
|
|
demxine wrote: I'm trying to restrict my dialog window from being moved outside the visible screen area.
I did this before by handling the WM_MOVING message. See here.
"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
|
|
|
|
|
<br />
<br />
HWND h;<br />
<br />
long l = (long)h;
<br />
how to correct change HWND to long?
|
|
|
|
|
Which warning?
I can see only "warning C4700: local variable 'h' used without having been initialized" in VC6 with warning level 4.
|
|
|
|
|
|
On 32-bit platforms the two data types have the same size hence the cast is harmless. The compiler warns because this can be an issue when you port the code to 64-bit platforms.
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]
|
|
|
|
|
now, I can also use these code
<br />
LONG64 l64Temp = (LONG64)m_hWnd;<br />
long lTemp = static_cast<long>(l64Temp);<br />
</long>
|
|
|
|
|
Why would you use that 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.
[my articles]
|
|
|
|
|
hanlei0000000009 wrote: long l = (long)h; // warning
convert that back to HWND after converting to LONG, if it is working than it is fine. i too have used this technique many times, and face to problem.. wishes same for you!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/codeProject$$>
|
|
|
|
|
|
To expand on CPallini's response [^]- you can turn off the "unsafe on 64-bit platform" warnings. Propeties => Configuration Properties => C / C++ => General => Detect 64-bit Portability Issues.
Judy
|
|
|
|
|
|
Hi All,,
I am developing Windows service using VC++ Template which will start before user login. And I want to catch that logon event into my Service.
As my thread subject indicates, I want to use ISensLogon structure into my Application.So, I have to include Sensevts.h file into my project file.And when I include this header file I get lots of errors.And these errorscome into the Sensevts.h file.
I am confused with this problem, is there any mistake which I do or I have link Sensevts.tlb type library into my project which is related to this header file.
Thanks in Advance.
Ashish Bhatt,
System Developer,
Avinashi System Pvt. Ltd.
|
|
|
|
|
I found that none of these masters are able give this simple question or not interested in my question!!!!!!!!!!!!!
Anyway I want to give some more description about my problem that I found from googling that I can add this SENS type library from the reference option in the project.
I tried this ....
Project properties->Common propeties->reference->Add new reference->COM Tab
here we can add this type library.But in my case I did not find this library into this list.
I want to ask you that I will have to include sens.dll into my project which is related to this library.
Plz. help me I am stuck in my work.
Thanks in Advance.
Ashish Bhatt,
System Developer,
Avinashi System Pvt. Ltd.
|
|
|
|
|
When that header is included in a managed app, you get the errors you mention. When it is included in a straight C++ app, it works fine. The included template creates a managed app, therefore ... I don't do managed apps so I can't tell you how to include Platform SDK functionality in your service. If you don't need the managed stuff, make your service pure C++.
Judy
|
|
|
|