Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
K

KKumarTG

@KKumarTG
About
Posts
15
Topics
4
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Value of dmPaperSize in DEVMODE structure for custom papersize
    K KKumarTG

    vcpgmr wrote:

    is it possible to know the dmPaperSize for custom paper size for a particular printer

    Hi, Did you try like this? pDevModeOutput->dmFormName = NewFormName; pDevModeOutput->dmPaperSize = DMPAPER_USER; pDevModeOutput->dmPaperLength = CustomLength; pDevModeOutput->dmPaperWidth = CustomWidth;

    Krishnakumar

    C / C++ / MFC

  • help
    K KKumarTG

    Hi, If you want .hlp type help file you can use 'Help workshop' in Visual Studio Tools. 1. U have to create a .rtf file( say using Microsoft word ) in which the help text contains. 2. Create a new project in Help work shop 3. Add the RTF file in the Help project 4. Compile

    Krishnakumar

    C / C++ / MFC c++ question help

  • Printer DC
    K KKumarTG

    Hi, The way I change the paper size is given below pDevModeOutput->dmPaperSize = 0; // It should be set to zero if paper length and width are given seperately pDevModeOutput->dmPaperLength = pPaperSizes[nSelection].y; // 2970 in case A4 pDevModeOutput->dmPaperWidth = pPaperSizes[nSelection].x; // 2100 in case A4 CString csPaperSize = _T( "" ); memcpy( pDevModeOutput->dmFormName, csPaperSize.GetBuffer(csPaperSize.GetLength()), 32) ; pDevModeOutput->dmPrintQuality = -1; pDevModeOutput->dmYResolution = 0; //pDevModeOutput->dmScale = 90; pDevModeOutput->dmFields = DM_PAPERSIZE | DM_PAPERLENGTH | DM_PAPERWIDTH | DM_FORMNAME | DM_PRINTQUALITY | DM_YRESOLUTION; // DM_SCALE; // To get the Devmode structure filled if( !DocumentProperties( NULL, // handle to parent window hHandle, // handle to printer object csPrinterName.GetBuffer(csPrinterName.GetLength()+1), // device name pDevModeOutput, // modified device mode 0, // original device mode DM_IN_BUFFER// mode options )) { return; } hDc = CreateDC( NULL, csPrinterName.operator LPCTSTR(), NULL, pDevModeOutput ); nDPIX = GetDeviceCaps( hDc, LOGPIXELSX ); nDPIY = GetDeviceCaps( hDc, LOGPIXELSY ); Actually I don't know the procedure that how to change the paper size. I think some mistakes are there in my code or something is missing. I have to draw a rectangle that is fit into the specified paper size. Please reply.

    Krishnakumar

    C / C++ / MFC help question

  • Printer DC
    K KKumarTG

    As per MSDN, the below code returns the width and height in pixels, int nX = GetDeviceCaps( hDc, HORZRES ); int nY = GetDeviceCaps( hDc, VERTRES ); Actually i meant that for some of the printers ( HP LaserJet 4250 PCL 5e ), the code gives different values for different sheet sizes. But the problem is that some of other printers (hp deskjet 3500 series) gives the same values for different papaer sizes. I am setting the size using the "DocumentProperties" function as below pDevModeOutput->dmPaperSize = 0; // It should be set to zero if paper length and width are given seperately pDevModeOutput->dmPaperLength = pPaperSizes[nSelection].y; // 2100 in case A4 pDevModeOutput->dmPaperWidth = pPaperSizes[nSelection].x; // 2970 in case A4 CString csPaperSize = _T( "" ); memcpy( pDevModeOutput->dmFormName, csPaperSize.GetBuffer(csPaperSize.GetLength()), 32) ; pDevModeOutput->dmPrintQuality = -1; pDevModeOutput->dmYResolution = 0; //pDevModeOutput->dmScale = 90; pDevModeOutput->dmFields = DM_PAPERSIZE | DM_PAPERLENGTH | DM_PAPERWIDTH | DM_FORMNAME | DM_PRINTQUALITY | DM_YRESOLUTION; // DM_SCALE; // To get the Devmode structure filled if( !DocumentProperties( NULL, // handle to parent window hHandle, // handle to printer object csPrinterName.GetBuffer(csPrinterName.GetLength()+1), // device name pDevModeOutput, // modified device mode 0, // original device mode DM_IN_BUFFER// mode options )) { return; }

    Krishnakumar

    C / C++ / MFC help question

  • Printer DC
    K KKumarTG

    Me already tried the below code szPrintablePixelsMax.cx= ::GetDeviceCaps (hPrinterDC, HORZRES); szPrintablePixelsMax.cy= ::GetDeviceCaps (hPrinterDC, VERTRES); it always returns the same value for all sheet sizes. Regards, Kumar

    C / C++ / MFC help question

  • Printer DC
    K KKumarTG

    Hi, Actually i want to know that, whether the printer DC is to be resized according to the paper sizes. If yes, how can i change the size? Me already checked with the following code for( int nIndex = 0; nIndex < nNumPapers; nIndex++ ) { CString csPaperSize = _T( pPaperNames ); /* Got from GetDeviceCapabilities */ memcpy( pDevModeOutput->dmFormName, csPaperSize.GetBuffer(csPaperSize.GetLength()), 32) ; HDC hTempHandle; pDevModeOutput->dmFields |= DM_FORMNAME; CString csTemp( _T( "" )); hTempHandle = ResetDC( hDc, pDevModeOutput ); nPixelX = GetDeviceCaps( hDc, HORZRES ); nPixelY = GetDeviceCaps( hDc, VERTRES ); csTemp.Format( _T( "%s : %d, %d" ), pDevModeOutput->dmFormName, nPixelX, nPixelY ); AfxMessageBox( csTemp ); } but the nPixelX, nPixelY always getting the same for all paper sizes Regards, Krishnakumar

    C / C++ / MFC help question

  • Printer DC
    K KKumarTG

    Hi, I have to print images from my application. For doing this, I created a Printer DC and the images is painted using 'StretchDIBits'. Now the printing is OK. The problem is of the sheet size. How can i change the print size according to the different sheet sizes supported by the specified printer? Please help. Regards, Kumar

    Krishnakumar

    C / C++ / MFC help question

  • [Message Deleted]
    K KKumarTG

    [Message Deleted]

    C / C++ / MFC

  • Foreground process
    K KKumarTG

    I tried. But now also the window (in tastbar icon) is flashing ( not getting the focus ). :( Krishnakumar

    C / C++ / MFC tutorial

  • Foreground process
    K KKumarTG

    My problem is that, I want to make a window active ( foreground ). When i do this, the window icon in the taskbar is flashing. Not getting exact focus. (Used function 'SetForegroundWindow()') Please comment Krishnakumar

    C / C++ / MFC tutorial

  • Foreground process
    K KKumarTG

    How to make a process foreground. Krishnakumar

    C / C++ / MFC tutorial

  • Window activation
    K KKumarTG

    Icon in the task bar is flashing... Krishnakumar

    C / C++ / MFC help

  • Window activation
    K KKumarTG

    Tried. Still dialog has no focus. :-( Krishnakumar

    C / C++ / MFC help

  • Window activation
    K KKumarTG

    SetActivateWindow function returns the same window handle Krishnakumar

    C / C++ / MFC help

  • Window activation
    K KKumarTG

    Hi, I have a program, which has a timer and dialog. Program purpose is to set the window on top most and active in a specified interval. Problem is that the dialog is getting on the top most. That is ok. But not getting activated ( No focus ). Please see the code: void CTestSetWPosDlg::OnTimer( UINT nIDEvent ) { CDialog::OnTimer( nIDEvent ); SYSTEMTIME stSystemTime; GetLocalTime( &stSystemTime ); CString csTime; csTime.Format( "%d:%d", stSystemTime.wMinute, stSystemTime.wSecond ); SetWindowText( csTime.operator LPCTSTR()); SetWindowPos( &wndTopMost, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_ASYNCWINDOWPOS ); SetActiveWindow(); } Krishnakumar

    C / C++ / MFC help
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups