|
Let me know where I can look at your code and I will take a stab at it.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Hello, please excuse my bad english....
I want to create a resizeable rect. (I know I can do this with WS_THICKFRAME, but the Border is to thick...)
So I override the WM_NCCALCSIZE function and deflate my window about 5 pixel. So I had a new Non-Client area. When I receive for example a WM_NCMOUSEMOVE message the nHitTest-Paramter is HT_BORDER and not for example HT_LEFT (when I move from the left side). Why send the OnHitTest method not HT_LEFT? Is there a chance to calc the correct Message automaticly (as WS_THICKFRAME)
|
|
|
|
|
I did this in the InitInstance
m_pMainWnd = new CMainFrame;
m_pMainWnd->LoadFrame(IDR_MAINFRAME);
m_pMainWnd->ShowWindow(SW_SHOW);
m_pMainWnd->UpdateWindow();
The problem is that my toolbar insists on being in the child area. ie, it is inside the client edge of the framewindow.
What is wrong?
CMainFrame::OnCreate looks like this.
if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
if (!m_toolbar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
!m_toolbar.LoadToolBar(IDR_MAINFRAME))
{
return -1;
}
m_toolbar.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockControlBar(&m_toolbar);
return 0;
My article on a reference-counted smart pointer that supports polymorphic objects and raw pointers
modified 29-Aug-18 21:01pm.
|
|
|
|
|
|
Does anybody have an example that reads Unicode text file?
Thanks in advance!
Best regards,
Vladimir
|
|
|
|
|
I very badly need to get an old copy of Borland C++ 4.5 or 5.0 with OWL for an old project....my old hard drive died, and i need to rebuild something!
Please email me if anyone can find the old CD.....
|
|
|
|
|
My school provides a link to an old copy (yes, I'm sad to say that my school actually uses Borland)...
Try this
Hope it's what your looking for,
~ Selevercin
If you have a problem with my spelling, just remember that's not my fault. I [as well as everyone
else who learned to spell after 1976] blame it on
Robert A. Kolpek for U.S. Patent 4,136,395.
|
|
|
|
|
I created a dialog box and added a button to close the dialog box when I was finished. I added CDlg::EndDialog(nResults); and it didnt work when I moved the source code onto the PDA?
RebelCause
|
|
|
|
|
I created a long dialog box. I added a scrollbar in the properties of the dialog box. When I load the dialog box on the PDA I dont get a scroll bar?
Need Help
RebelCause
|
|
|
|
|
I can make my dialog to become a full screen dialog by using following putting code inside the OnInitDialog()
SetWindowPos(&wndTopMost,0,0::GetSystemMetrics(SMCXSCREEN),::GetSystemMetrics(SM_CYSCREEN),SWP_SHOWWINDOW);<br />
Only dialog get full screen but all the items, listctrl, combo box,etc.. on the dialog still the same size.. how can i make a full screen dialog and resizing all the item on that dialog as dialog get larger.
Thanks
|
|
|
|
|
|
I have a modeless dialog that pops up a MODAL dialog. What I want to do is position that MODAL child relative to the "parent" modeless dialog - offset upper-left corner by +50.
What I can't do is get a pointer to the modeless (parent) dialog. My code just references the governing MainFrame window. Here is what I'm trying:
BOOL CPopUpDlg::OnInitDialog()
{
CDialog::OnInitDialog();
CRect pRect;
CWnd *pParentWnd;
pParentWnd = GetParent(); // tried GetParentOwner() too
pParentWnd->GetWindowRect(&pRect);
MoveWindow(pRect.left + 50, pRect.top + 50, 400, 400, NULL);
return (TRUE);
}
Can you help/explain how I reference the correct modeless parent I want?
Thanks.
John
|
|
|
|
|
GetParent() should return a pointer to the modeless dialog, if that is in fact who created CPopUpDlg .
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Ok, here is what I have:
A modeless CPropertySheet derived dialog with a CButton that pops up a modal dialog. The modal dialog I use to collect a couple fields of data SPECIFIC to the parent modeless Sheet.
What happens now is when I pop up the modal dialog, the positioning is relative to the Main Frame.
I want the modal dialog to be placed right over the modeless Sheet (dialog).
Also, I can see that my method of placing the modal dialog is relative to the Main Frame because when I move the Main Frame around, the modal dialog is offset +50 from the Main Frame.
Thanks for help (in advance)
|
|
|
|
|
Try using SetWindowPos() if MoveWindow() doesn't work. (Cheesy answer, I know).
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
GetWindowRect() returns screen coordinates and MoveWindow() uses client coordinates for child windows. Try using ScreenToCLient(). Also how do you know GetParent() is returning the MainFrame. Have you verified this somehow.
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|
|
The displacement of the window works (one way or the other - sans ScreenToClient()),
However, I see that the coordinates and thus my ParentWnd reference are with respect to the MainFrame.
When I move the main frame (the window with the menu bar and tool bar for my app), the modal window is offset the same amount with respect to the main frame's window. This is the case every time I popup the modal window from my modeless property sheet.
Any ideas???
|
|
|
|
|
Does the code the creates the modal popup dialog specify the modeless dialog as its parent? Also if you look at the Window info for the Modal dialog in Spy++ or WinSpector is it correct?
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|
|
I don't do it explicitly. The modeless property sheet (or the property page on the sheet) calls DoModal().
So it happens like this:
void CPage2Dlg::OnButton()
{
CPopUpDlg dlg;
dlg.DoModal(); // position WRT the modeless parent
}
Using Spy++, I get some wacked results -- in the OnInitDialog() of the modal dialog, GetParent() returned and address different that what I found using Spy++ for:
(Main Frame) - 0x002204EC
Prop Sheet - 0x000D0534
modal dialog itself - 0x00030DC0
GetParent() -- 0x00355290
Oh the agony!!!!
|
|
|
|
|
<br />
void CPage2Dlg::OnButton()<br />
{<br />
CPopUpDlg dlg(WHATEVER_TEMPLATE_ID_YOU_ARE_USING,this);<br />
<br />
dlg.DoModal();
<br />
}
afaik, it should work
eperales
|
|
|
|
|
Well I think you are getting a bit closer. Track down what window 0x00355290
is on Spy++. You either need to set the Modal dialog up so GetParent() returns the right thing, or find another way to get the Modeless dlg hWnd.
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|
|
Save the property sheet's pointer in the property page, and pass it to CPopUpDlg in OnButton() . That will guarantee that you have the right origin window.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Hello there,
I wrote a MFC exe project, How can i make an ActiveX of it ?
Regards,
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Is there a way with the CWebBrowser2 Control to know if URL that i want to display is invalid (wrong URL, File does not exist, Connection Problem ....) ?
Thanks
Olivier
|
|
|
|
|
I have found the solution :
In the event sink map, you have to add
ON_EVENT(CWebBrowser2, ID_WEB_CTRL, DISPID_NAVIGATEERROR, OnNavigateError, VTS_DISPATCH VTS_PVARIANT VTS_PVARIANT VTS_PVARIANT VTS_PBOOL)
and in the code :
<br />
void CWebBrowser2::OnNavigateError (LPDISPATCH lpDisp,VARIANT FAR* URL, VARIANT FAR* TARGET , VARIANT FAR* STATUS, VARIANT_BOOL * CANCEL)<br />
{<br />
*CANCEL = VARIANT_TRUE;<br />
}<br />
|
|
|
|