|
It is my class with a base class of CMFCToolBar
|
|
|
|
|
See if CMFCToolBar::LoadState[^] is called. Find it in the MFC sources and put a breakpoint on it. On my computer it's in C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\src\mfc\afxtoolbar.cpp
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
I'm coding with VC++2008.
When designing the layout of the controls in the .rc file, we can see their coordinates in the bottomright of the screen.
And now I have a control with (4,30) shown there and another one with (5,156). Then I wanna draw a line between these 2 controls using the coordinates by GDI.
pDC->MoveTo(4,30);
pDC->LineTo(5,156);
But at runtime, the line doesn't correspond to those coordinates. I mean there is a big offset from the expected position.
What's wrong?
Thx in advance.
|
|
|
|
|
Units in the resource editor are in DLU ( Dialog (il)Logical Unit); they are used to handle the large font/small font display settings.
from msdn :
dialog unit
A unit of horizontal or vertical distance within a dialog box. A horizontal DLU is the average width of the current dialog-box font divided by 4. A vertical DLU is the average height of the current dialog-box font divided by
M.
Watched code never compiles.
|
|
|
|
|
|
if you want to draw a line between two controls, the safest way is to get the controls' actual on-screen positions, something like:
CRect r1, r2;
ctrl1.GetWindowRect(&r1);
ScreenToClient(r1);
ctrl2.GetWindowRect(&r2);
ScreenToClient(r2);
dc.MoveTo(r1.right, r1.top);
dc.LineTo(r2.left, r2.top);
|
|
|
|
|
|
I have a xml file which hold the structre of Menu items . I want to create the Menu at runtime by reading the XML file .
Can any body help to know how to do this.
Thaks.
|
|
|
|
|
Use the CreateMenu()[^] and associated functions, using the data from your XML file.
It's time for a new signature.
|
|
|
|
|
Hi all,
i have number of items and subitems in list.
no i want to find the clicked item or subitem on double click of ListCtrl.
and also fetch the text of clicked cell.
please tell me how can i do this.
thanks in advance.
|
|
|
|
|
I'm not sure which control you are using but most of the information you need should be here[^].
It's time for a new signature.
|
|
|
|
|
Le@rner wrote: no i want to find the clicked item or subitem on double click of ListCtrl.
Are you referring to this notification?
"One man's wage rise is another man's price increase." - Harold Wilson
"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
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
|
How about you stick with your original thread here[^]? Go back there and use the "improve question" link to tell us what you've tried and what "not working" means.
Software rusts. Simon Stephenson, ca 1994.
|
|
|
|
|
|
Just used the incredible tool Google, and found this[^]. It does pretty much what I understood you need. Implementation uses boost components for thread locking.
Edit: It has a few limitations, as not being able to use a timeout when waiting for elements, but since the source code is provided you can easily add such functionality if desired. If you don't fancy boost, you can replace it with a critical section or equivalent.
|
|
|
|
|
Personally, it'd be like the following:
char str[3];
CFile file;
....
while( !EOF() )
{
file.Read( &str, 3 );
}
file.Close();
But IDK how to write the codes for "!EOF()".
Or any other ways to read files continuously?
Thx in advance!
PS: .txt files
|
|
|
|
|
What do you mean exactly by "continuously" ?
Do you mean you want to read the complete file ?
|
|
|
|
|
yep!
In fact I wanna plot a range of x- and y-coordinates onto a graph while reading them in a txt file.
So I used "continuously".
|
|
|
|
|
The Read function returns the number of bytes read. When there's nothing more to read (because you reached the end of the file), the function will return 0.
|
|
|
|
|
|
What's wrong with:
while( file.Read( &str, 3 ) == 3 )
{
}
That will terminate the loop if it can't read 3 bytes from the file.
Cheers,
Ash
modified on Monday, September 6, 2010 12:17 PM
|
|
|
|
|
Aescleal wrote: What's wrong with: while...
The concept is OK, some details are all wrong.
|
|
|
|
|
Don't know what you're taking about!
(Thanks!)
Ash
|
|
|
|
|
No problem.
|
|
|
|