CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: Roger Allen

Page 1 of 78 1 2 3 4

Search: Search took 0.33 seconds.

  1. Replies
    4
    Views
    674

    Re: PrintPreview. Inches border

    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...
  2. Replies
    5
    Views
    1,392

    Re: Removing the border of the popupmenu

    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 /...
  3. Replies
    9
    Views
    2,720

    Re: how to update or refresh the menu?

    If your updating a menu which is currenty selected into a window you need to call DrawMenuBar(HWND) to cause it to refresh.
  4. Replies
    5
    Views
    979

    Re: Print in PrintPreview problem

    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...
  5. Replies
    25
    Views
    8,399

    Re: Override any function in DLL

    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...
  6. Re: How to create DC with specific resolution?

    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;
    ...
  7. Replies
    3
    Views
    841

    Re: HWND handle

    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.
  8. Replies
    3
    Views
    853

    Re: Printing image?

    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...
  9. Re: How to create DC with specific resolution?

    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...
  10. Re: How to include .rc file in another .rc file

    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...
  11. Replies
    5
    Views
    767

    Re: Problem while debugging

    You may have a registry entry which is telling another loaded object where to try and load the DLL from.
  12. Replies
    2
    Views
    2,726

    Re: dll exitinstance never called?

    You could probably put the required code in:

    DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID)

    where dwReason = DLL_PROCESS_DETACH
  13. Re: Debug error in cpropertysheet::removepage()

    You also cannot remove the final page. A PropertySheet must contain at least 1 page aftre it has been created.
  14. Re: Documens was'n printed out but could preview?

    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
  15. Replies
    2
    Views
    769

    Re: Capturing the length of a key press

    You may find that setting a hook using



    // setup the keyboard hook
    m_keyboardHookHandle = ::SetWindowsHookEx(
    WH_KEYBOARD,
    KeyboardHookFunction,
    ...
  16. Replies
    4
    Views
    2,203

    Re: Problem with OnPrint in MFC

    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:
    ...
  17. Replies
    4
    Views
    1,582

    Re: BitBlting on a printer hdc

    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...
  18. Replies
    2
    Views
    988

    Re: Repaint Items in OwnerDraw Menu

    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...
  19. Re: Wish to access previous CDocument items when a new one is opened in MFC.

    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...
  20. Replies
    1
    Views
    861

    Re: MDI App with Plugins

    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...
  21. Replies
    5
    Views
    2,491

    Re: Title Bar Color

    This article http://www.codeproject.com/gdi/customcaption.asp

    shows how to change colours / caption styles although it may be slightly outdated for XP
  22. Replies
    15
    Views
    5,888

    Re: BUG at Print ?!

    Check your applications .rc file and that it has this at he end:



    #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
    #ifdef _WIN32
    LANGUAGE 9, 1
    #pragma code_page(1252)
    #endif //_WIN32...
  23. Re: Problem with owner draw menu's and appendMenu

    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.

    You...
  24. Re: Problem with owner draw menu's and appendMenu

    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:



    CNewMenu menu;

    menu.Attach(hMenu);
    // use CNewMenu get menu string...
  25. Replies
    2
    Views
    855

    Re: Detect print jobs sent

    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...
Results 1 to 25 of 1941
Page 1 of 78 1 2 3 4





Click Here to Expand Forum to Full Width

Featured