|
CDialog::MapDialogRect
void MapDialogRect( LPRECT lpRect ) const;
Parameters
lpRect
Points to a RECT structure or CRect object that contains the dialog-box coordinates to be converted.
Remarks
Call to convert the dialog-box units of a rectangle to screen units. Dialog-box units are stated in terms of the current dialog-box base unit derived from the average width and height of characters in the font used for dialog-box text. One horizontal unit is one-fourth of the dialog-box base-width unit, and one vertical unit is one-eighth of the dialog-box base height unit.
The GetDialogBaseUnits Windows function returns size information for the system font, but you can specify a different font for each dialog box if you use the DS_SETFONT style in the resource-definition file. The MapDialogRect Windows function uses the appropriate font for this dialog box.
The MapDialogRect member function replaces the dialog-box units in lpRect with screen units (pixels) so that the rectangle can be used to create a dialog box or position a control within a box.
CDialog Overview | Class Members | Hierarchy Chart
------------------------------
Smaller Animals Software, Inc.
http://www.smalleranimals.com
|
|
|
|
|
m_imageList.Create(16,16, ILC_COLOR | ILC_MASK, 4, 0);
CBitmap bm;bm.LoadBitmap(IDB_BITMAP1);
m_imageList.Add(&bm, RGB(255, 255, 255)); // error here
bm.DeleteObject();
bm.LoadBitmap(IDB_BITMAP2);
m_imageList.Add(&bm, RGB(255, 255, 255)); // error here
the code above can't work. i copied this from a sample cod in the MSDN library but it just doesn't work! it gives the error:
"error C2064: term does not evaluate to a function"
did i forget to include some header file? it says in the MSDN that I have to include "windows.h", where do i include this file? or has it already been included?
|
|
|
|
|
Compiles fine on my PC. Are you *sure* this is exactly as it is on your screen, and that this is the error ? You wouldn't have got this far without windows.h - you get all that stuff for free if you used a wizard to create your project. If for some reason you've 'lost' the RGB macro, just pass 0xFFFFFF as the parameter, that's where you're headed in any case ( or maybe it's oxFFFFFF, in any case a value here should compile if the problem is something bizarre with RGB )
Christian
#include "std_disclaimer.h"
|
|
|
|
|
I want use my software to post data to the webpage.
In some search engines page there is a form for you to enter some keywords,and how can I submit these keywords use software and get the results?
thx a lot
|
|
|
|
|
Take a look at all the Internet and Http functions, like InternetOpen(), InternetReadFile() and a lot of others...
To post data you can use HttpSendRequest()
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Does anyone have any idea why the following code would return 0 elements in a HTML page?
<br />
CWebBrowser *pWB = &m_WebBrowser;
LPDISPATCH pDocDisp = NULL;<br />
<br />
pDocDisp = pWB->GetDocument();<br />
ASSERT(pDocDisp);<br />
<br />
IHTMLDocument2 *pHTMLDoc;<br />
pDocDisp->QueryInterface(IID_IHTMLDocument2, (void**)&pHTMLDoc);<br />
<br />
IHTMLElementCollection* pElemColl = NULL;<br />
HRESULT hr = pHTMLDoc->get_all(&pElemColl);<br />
<br />
long cElems;<br />
<br />
ASSERT(pElemColl);<br />
<br />
hr = pElemColl->get_length(&cElems);<br />
After this, cElems is 0!
Thanks in advance.
|
|
|
|
|
hi,
i have a sub-menu, ID_TOOLS_POINTS_CENTER
I like to activate the left mouse button after the user clicks on it....
can anyone help me out?????????/
Ehsan
Ehsan Behboudi
|
|
|
|
|
You want your program to think the left button is down when it is not ? Or you want the menu to disappear and the left button to stay down ? You've got problems - you'll need a hook for that I'd imagine, because generally the menu item is not called until you *raise* the button. You're talking about changing default UI behaviour - usually a *bad* idea.
Christian
#include "std_disclaimer.h"
|
|
|
|
|
Hi,,
I like to know how can I draw two perpendicular lines, from a specified point (CPoint).
the point (CPoint) is clicked by the user. and as soon as the user clicks, I want the lines to be draw.
|
|
|
|
|
---------------------CPoint---------------------- NOTE: the lines are ofcourse connected lines, not dashed
|
|
|
|
|
thanks for the help
Ehsan
Ehsan Behboudi
|
|
|
|
|
Something like this:
in OnLButtonDown
{
m_bDrawLine = true; // A flag telling us to draw a line
m_MousePos = point; // the position stored. Could also call GetCursoorPos/ScreenToClient in the OnPaint if you like
Invalidate(false); // Force a redraw, no erase
}
in OnPaint
{
CPaintDC dc(this); // device context for painting
if (m_bDrawLine)
{
m_bDrawLine = false;
dc.MoveTo(CPoint(m_MousePos.x, m_MousePos.y - 20);
dc.LineTo(CPoint(m_MousePos.x, m_MousePos.y + 20);
}
}
this will draw a 40 pixel high line either side of the point. Obviously, you'd want to pretty it up a lot, but you don't need to do any bounds checking - GDI will simply draw what it can and discard the rest. The problem you have though is that unless you build an array of points, etc., you will find they disappear when the window is redrawn, after a minimise for example, or being obscured by another window.
Christian
#include "std_disclaimer.h"
|
|
|
|
|
well, the subject says it all! i want to re-start my program (in a document/view MFC application) whenever the user selects a command from the menu. how do i do it? i need to access the pDoc pointer (which points to my data) from the MainFrm class. is it possible?
|
|
|
|
|
If you're in an MDI app, you can do this:
CMyDoc* pDoc = (CMyDoc*)MDIGetActive()->GetActiveView()->GetDocument();
Under SDI it's even easier:
CMyDoc* pDoc = (CMyDoc*)GetActiveView()->GetDocument();
Christian
#include "std_disclaimer.h"
|
|
|
|
|
i did this, and it worked. thanks.
CMyDoc *pDoc = (CMyDoc*) GetActiveDocument();
imran.
|
|
|
|
|
When I make a Dialog window (based on a resource) child of an MDI window, the caption bar appears inactive (grayed), however, my dialog is fully functional. Does anyone know how to make it look like an active window ?
David
|
|
|
|
|
Probably using the FormView class
|
|
|
|
|
Is there no way at all, besides the CFormview class ????????? I'm not that big of a fan of the Document/View architecture...
|
|
|
|
|
The D in MDI stands for Document, so you have chosen the Doc/View architecture, whether you decide to use it or not. The CFormView class *is* the way you can get an MDI application based on dialog templates. Otherwise you'd have to do something funky, like create a new, dialog based project and hold a vector of pointers to your child dialog boxes in it. I doubt this is viable, but it's not Doc/View.
Christian
#include "std_disclaimer.h"
|
|
|
|
|
Then could you tell me how to make it LOOK like a regular dialog... Without the minimize/maximize button and fixed size ?
|
|
|
|
|
The properties of the dialog template allow you to set if the border is resizing, and if there is a system menu/what is on it.
Christian
#include "std_disclaimer.h"
|
|
|
|
|
ohhh i'm in trouble! i have this small MFC application which shows a dialog box (modal one) and i just want the application to quit whenever the user presses the OK button on the dialog. how do i do it? i know onw thing: DoModal() returns an integer that tells me which button was pressed, so what do i do once i know it's an OK button? i've tried closeAllocuments but it doesn't help. it gives me some assert failure message. please help.
imran.
|
|
|
|
|
Post a WM_CLOSE message to your main window:
AfxGetMainWnd()->PostMessage(WM_CLOSE);
--Mike--
http://home.inreach.com/mdunn/
Tables, ladders, chairs, OH MY!
|
|
|
|
|
If you'd created a dialog based application, this should have happened for you automatically, but you can do it from anywhere with this:
PostQuitMessage(0);
Christian
#include "std_disclaimer.h"
|
|
|
|
|
i just knew mike and chris would be the first responders to my query. thanks guys, you've always saved my time!
imran.
|
|
|
|
|
I need to hide my picture(static-bitmap)that exist in my dialog resource
and to show it letter.
I successed to hide it with closeWindow() -> myPicture.CloseWindow();
But I dont success to show it with ShowWindow()
Who can help me ???
nili
|
|
|
|
|
ShowWindow( SW_HIDE ) and ShowWindow( SW_SHOW ) don't work???? I'm pretty sure you do not want to ujse CloseWindow, if you do, try useing OpenIcon to reverse it. I've never used that combination myself, but give it a whirl. If that doesn't work, you got me.
|
|
|
|