November 13th, 2005 01:58 PM
You can use the GetDeviceCaps function on the CDC of the printer in your OnPrint function. You can query the number of pixels per inch and from that indent the CPrintINfo::m_rectDraw member by the...
October 14th, 2005 02:32 PM
The problem you have is that the border is not part of your owner drawn menu. When a menu is popped up a window is created which has the border you need to remove. Handling the WM_MEASUREITEM /...
October 6th, 2005 10:57 AM
If your updating a menu which is currenty selected into a window you need to call DrawMenuBar(HWND) to cause it to refresh.
October 2nd, 2005 04:49 PM
You should not derive you view from CPreviewView. You should make sue of the standard MFC print/preview architecture.
To do this derive from CView and override the...
September 30th, 2005 08:00 AM
You could use one of the methods outlines here:
http://www.devx.com/Intel/Article/21023/2046
Persoinally, I have used the InterceptApi, which can be used for any type of DLL not just system...
September 30th, 2005 03:42 AM
This should do what you need, at a first attempt (not tested)
int dpiX = dc.GetDeviceCaps(LOGPIXELSX);
int dpiY = dc.GetDeviceCaps(LOGPIXELSY);
double xScale = requiredDpi / dpiX;
...
September 29th, 2005 11:21 AM
If the function that calls Text.BlendText is a member of your CSubtitlesDlg class, then you can just place GetSafeHwnd(). But the window must exist at the time of the call to get a valid HWND.
September 29th, 2005 07:42 AM
Two articles of mine which may be of help:
A print/preview extension DLL for CDialog:
http://www.codeproject.com/printing/printextension.asp
Printing tips n tricks - Shows how to print a...
September 29th, 2005 07:38 AM
Once you have a DC with a bitmap selected into it, you know the DC is running at 96 (or whetever) DPI. You know this needs to map onto a x * y bitmap.
You can calculate scaling coordinates for the...
September 29th, 2005 07:32 AM
Are the resources in your included .rc file in a different language? If they are, they will be ignored by the resource compiler.
You can tell what language your building for by checking your...
September 27th, 2005 08:15 AM
You may have a registry entry which is telling another loaded object where to try and load the DLL from.
September 27th, 2005 08:07 AM
You could probably put the required code in:
DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID)
where dwReason = DLL_PROCESS_DETACH
September 27th, 2005 04:57 AM
You also cannot remove the final page. A PropertySheet must contain at least 1 page aftre it has been created.
September 7th, 2005 09:55 AM
You probably need to call Detach() on the CDC object as by default CDC destructor is probbaly trying to delete teh DC, thus invalidating the print job in some way
August 17th, 2005 07:41 AM
You may find that setting a hook using
// setup the keyboard hook
m_keyboardHookHandle = ::SetWindowsHookEx(
WH_KEYBOARD,
KeyboardHookFunction,
...
August 5th, 2005 09:25 AM
This is because the printer DC does not support BitBlt while the screen DC during preview does.
You need to use StretchDIBits to draw the bitmap to the printer. See this article of mine:
...
August 3rd, 2005 07:09 AM
Actually its probably due to the printer DC not supporting BitBlt.
In MFC you see this where it works for print preview (A screen DC support BitBlt) and not for the rendered output (the printer DC...
August 1st, 2005 06:48 AM
The menu bar is a different window to the actual menu being displayed.
If you need a menu to re-drawn then you will have to hook the creation of the menu window (look for WM_CREATE and and window...