|
CWnd::GetWindowRect()
The above function gives a Result in 'Screen Coordinates' How do I transform these into coordinates usefull in a Dialog Box Display.
How do Screen Coordinates, Device Coordinates, and Logical Coordinates interact!
<Added 2 Jan 09>
I have a Dialog Based Application, and I want re-size the box. The Dialog has the appearance of Windows Explorer, and contains 2 Edit Controls (Path + Status), a Tree Control, and a List Control.
I am Writing the Handler:
void CXpMiniExplorerDlg::OnSize(UINT nType, int cx, int cy);
The Idea I had was to use pCtrl->GetWindowRect(...) to get the current location of each of the 4 controls, work out from cx amd cy what the new positions should be, and then use pCtrl->MoveWindow(...) to position them.
Does Not Work! The Controls move 211 units east, and 233 units south!
ScreenToClient, ClientToScreen, only make matters worse!
</Added>
Regards,
Bram
Bram van Kampen
modified on Friday, January 2, 2009 6:36 PM
|
|
|
|
|
|
Hi,
Thanks for your Reply. Have read the above, but it does not seem to have to say a lot about Dialog Based Apps. I expanded my original question a bit to clarify the problem a bit more.
Regards,
Bram van Kampen
|
|
|
|
|
no worries - I was hoping it would give you a little insight into co-ordinate mapping in general, more than specific to dialogs
hope you got an answer in the end
'g'
|
|
|
|
|
Unfortunately, No, I didn't sofar, but thanks anyways.
Bram van Kampen
|
|
|
|
|
|
|
Hi,
Thanks for your Reply. Have tried the above, but it does not seem to havework in Dialog Based Apps. I expanded my original question a bit to clarify the problem a bit more.
Regards,
Bram van Kampen
|
|
|
|
|
Hi all.
I have some problem using window, I need somting like panel, like div(layer) in HTML. I need window that have't border and title bur, only area. I need it to draw some animation for my ScreenSaver.
thanks and happy new year.
|
|
|
|
|
This article [^] maybe useful.
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]
|
|
|
|
|
thanks, but I write CLayer class, sow I have't problems.
|
|
|
|
|
Is it safe to write to a COM port on one thread while reading from it on another thread?
Do the writes and the reads have to be synchronized, or does the hardware and the driver take care of that?
|
|
|
|
|
Hi I write little rogram that use inp and outp functions.
It is like write and rad from console or read from file.
|
|
|
|
|
Could you give us an example that works unde XP?
Regards,
Bram van Kampen
|
|
|
|
|
I can give you a zip file (book + example).
but it is on Russia.
write your mail and I will send you.
|
|
|
|
|
I have an MFC dll which has no gui, and I dont see a Resource tab in the development environment on which I could drag a CProgressCtrl. I want to launch a progressbar from this dll, and don't really want to do message loops and such which I would need if I used CreateWindow(). Appreciate your input,
sb
|
|
|
|
|
Ugly idea, but what if you create the progress bar and then call the window method with WM_PAINT to get it drawn when you need it? No idea how that would behave...
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
|
|
|
|
|
From within the dll, I did this
myCtrl = new CProgressCtrl();
myCtrl->Create(WS_CHILD|WS_VISIBLE|PBS_SMOOTH, CRect(10,10,200,30),
(CWnd*)this, 100);
where the last parameter (100) is just a number I picked out of thin air. I don't know what I should put there.
So when I ran the project that calls this dll, it ran, but no progress bar showed up...
???
|
|
|
|
|
What is "this"? You need a valid window where you specified "this", where do you want your progress bar to appear? I think you could be better off with making a message loop...it's not that complicated really.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
|
|
|
|
|
There aren't any CDialog type windows, and 'this' is just some abstract class where I have the time-stepping loop.
Another thing I tried:
Even though it's a dll, I tried adding a form to it, and dragged a progressbar on it, but then didn't quite know how to invoke this form from my abstract class.
I'll look up the message loop idea. Thanks for the input.
sb
|
|
|
|
|
Hello
I have a C++ class with few attributes and functions. Whenever a new value is assigned to a particular attribute (say the attribute is an integer variable in the class) a function should get called (triggered) and the piece of code inside the function should get executed.
Is it possible? If yes, what is the mechanism. Please let me know.
Thanx
|
|
|
|
|
Can't you make the member as private/protected and provide a Set method?
Then inside Set method once variable is updated you can call the respective function..
Does it make sense..I hope it helps.
Regards,
Sandip.
|
|
|
|
|
Thanx Sandeep
Simple and effective solution
Regards,
Vipin.
|
|
|
|
|
Alternatively you could make wrapper classes for the members which on their = operator would call whatever is needed to be called.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
|
|
|
|
|
HI
I want to implement a cross layer approach. i want to pass the network information such as delay from the MAC layer to Network layer. Can you tell me the way i am new to this. i am using linux (fedora). I think some system call will do the trick. Correct me if i am wrong. Any help in this regard is greatly appreciated.
|
|
|
|