Professional UI Solutions
Site Map   /  Register


Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » Handling of CExtPPVW is changed, and I am troubled. Collapse All
Subject Author Date
tera tera Apr 9, 2009 - 10:56 PM


In prof2.84, I was able to perform a print preview definitely as follows.

However, In prof2.85, it is displayed greatly.

Print and a preview are not possible normally.

I am troubled.

Please teach an improvement method

About the method that we adopt

I make the wmf file of the dummy.

I acquire the dot domain that I can print from the dummy file.

I draw in the dot domain.


    CSize   csSize;     CString csStr;

    csStr  = MetafileCache_GetFolder();     csStr += "metafilesizeget123.emf";

    if ( _access( csStr , 0) == 0 ) {     DeleteFile( csStr );     }     CMetaFileDC dcEMF;     if( ! dcEMF.CreateEnhanced(     NULL,     csStr,     rcEmfExtent,     NULL     )     )     {     //     ASSERT( FALSE );     throw 0;     }     dcEMF.SetBkColor ( RGB(255,255,255) );     dcEMF.SaveDC();     dcEMF.RestoreDC( -1 );     HENHMETAFILE hEMF = dcEMF.CloseEnhanced();     DeleteEnhMetaFile( hEMF );

    WCHAR wszText[1024];     MultiByteToWideChar(     CP_UTF8, 0,     csStr.GetBuffer(256),     strlen(csStr.GetBuffer(256))+1,     wszText,     (int)sizeof(wszText)     );

    Gdiplus::Metafile metafile( wszText );     Gdiplus::MetafileHeader mtfHeader;     metafile.GetMetafileHeader(&mtfHeader); = mtfHeader.Width; = mtfHeader.Height;

    return csSize;

Technical Support Apr 13, 2009 - 1:17 PM

Here is the modified version of your test project:

We changed the coordinate computation and painting code.