Type: Posts; User: Roger Allen
Search took 0.06 seconds.
November 13th, 2005, 02: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, 03: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, 11: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, 05: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, 09:00 AM
You could use one of the methods outlines here:
Persoinally, I have used the InterceptApi, which can be used for any type of DLL not just system...
September 30th, 2005, 04: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, 12:21 PM
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, 08:42 AM
Two articles of mine which may be of help:
A print/preview extension DLL for CDialog:
Printing tips n tricks - Shows how to print a...
September 29th, 2005, 08: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, 08: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, 09: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, 09:07 AM
You could probably put the required code in:
DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID)
where dwReason = DLL_PROCESS_DETACH
September 27th, 2005, 05: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, 10: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, 08:41 AM
You may find that setting a hook using
// setup the keyboard hook
m_keyboardHookHandle = ::SetWindowsHookEx(
August 5th, 2005, 10: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, 08: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, 07: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...
July 26th, 2005, 10:03 AM
You just need to access it as a normal object, but as your the same class type, the compiler assumes you know what your doing so you can access all the variables as if they are public.
If you look at my article http://www.codeproject.com/library/piarchitecture.asp which covers an MFC plug-in architecture which allows additional doc templates etc. It also comes with some...
This article http://www.codeproject.com/gdi/customcaption.asp
shows how to change colours / caption styles although it may be slightly outdated for XP
June 30th, 2005, 01:08 PM
Check your applications .rc file and that it has this at he end:
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
LANGUAGE 9, 1
June 21st, 2005, 12:02 PM
Oh, and one other thing whilse it occurs to me.
You could modify the CNewMenu append function(s) to set the menu string in the HMENU text so GetMenuItemInfo() would return the ocrrect text.
June 21st, 2005, 11:58 AM
You may only have an HMENU at the time in the CMenuBar but you should be able to convert it to a CNewMenu like this:
// use CNewMenu get menu string...
June 20th, 2005, 12:41 PM
Do a search in the MSDN for a topic "Printing and Print Spooler Functions" which should list any functions you could use to nteract with the print spooler (You may have to use search instead of Index...
Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.