Click here to Skip to main content
16,005,734 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: mapped network disk. Pin
GooGoo13-May-02 4:19
GooGoo13-May-02 4:19 
Generaltype casting Pin
NicholasCougar12-May-02 23:34
NicholasCougar12-May-02 23:34 
GeneralRe: type casting Pin
Niklas L12-May-02 23:48
Niklas L12-May-02 23:48 
GeneralRe: type casting Pin
Jon Hulatt13-May-02 0:12
Jon Hulatt13-May-02 0:12 
GeneralRe: type casting Pin
Nish Nishant13-May-02 0:07
sitebuilderNish Nishant13-May-02 0:07 
GeneralRe: type casting Pin
Paul M Watt13-May-02 6:05
mentorPaul M Watt13-May-02 6:05 
GeneralRe: type casting Pin
Aizik Yair13-May-02 22:27
Aizik Yair13-May-02 22:27 
GeneralATL Design Mode bad IPicture Pin
Braulio Dez12-May-02 22:56
Braulio Dez12-May-02 22:56 
Hi,

When I´m in Run mode, my ActiveX displays my IPicture object without problem, but, when I want to print or go to design mode ( using MS-WORD), then it only shows some part of the metafile.. Frown | :-(

My rendering code is:

CComQIPtr<IPicture>   _Pict;  // This holds a metafile

   
/* -----------------------------------------------------------
      Why this doesn´t draw well in Design Mode ?
   ----------------------------------------------------------- */
HRESULT OnDraw(ATL_DRAWINFO& di)
{
   T* pT = static_cast<T*>(this);
   
   RECT& rc = *(RECT*)di.prcBounds; 	
   RECT r = rc;                                                            
   long lPicWidth  = 0;
   long lPicHeight = 0;      


   BOOL bRunTime = FALSE;
   Rectangle(di.hdcDraw, 0, 0, rc.right, rc.bottom); // Simple Border...

   if(_Pict) {                  
      _Pict->get_Width(&lPicWidth);
      _Pict->get_Height(&lPicHeight);

      // ----- Trying to scale
      SIZE szPic;szPic.cx = lPicWidth;szPic.cy = lPicHeight;

      SIZE szCanvas; szCanvas.cx =  rc.right; szCanvas.cy = rc.bottom;
      SIZE ScaledSize = ScaleCoordinates(szPic, szCanvas);
      
      HRESULT hres = _Pict->Render(di.hdcDraw, 0, 0, ScaledSize.cx, ScaledSize.cy, 0, lPicHeight, lPicWidth, -(lPicHeight), &r);                
   }
   return S_OK;
}


Is there anything wrong ? Or maybe trying to draw a metafile from IPicture to another metafile, doesn´t work ( shiiit !) ?

Thanks in advance, greetings
Braulio
GeneralCode a Fax Service Pin
Sameer Maggon12-May-02 22:56
Sameer Maggon12-May-02 22:56 
GeneralRe: Code a Fax Service Pin
Michael P Butler13-May-02 0:26
Michael P Butler13-May-02 0:26 
GeneralRe: Code a Fax Service Pin
Sameer Maggon13-May-02 0:25
Sameer Maggon13-May-02 0:25 
GeneralRe: Code a Fax Service Pin
Michael P Butler13-May-02 0:49
Michael P Butler13-May-02 0:49 
GeneralDBF from VC++ Pin
12-May-02 22:23
suss12-May-02 22:23 
GeneralRe: DBF from VC++ Pin
Niklas L12-May-02 22:43
Niklas L12-May-02 22:43 
GeneralRe: DBF from VC++ Pin
12-May-02 22:49
suss12-May-02 22:49 
GeneralIPicture and Printing/Design Mode problems Pin
Braulio Dez12-May-02 21:19
Braulio Dez12-May-02 21:19 
GeneralFax Service Pin
Sameer Maggon12-May-02 21:26
Sameer Maggon12-May-02 21:26 
GeneralRe: Fax Service Pin
Michael P Butler12-May-02 22:11
Michael P Butler12-May-02 22:11 
QuestionadgHANDLE_DLGMSG??? Pin
NicholasCougar12-May-02 21:16
NicholasCougar12-May-02 21:16 
AnswerRe: adgHANDLE_DLGMSG??? Pin
Nish Nishant12-May-02 21:26
sitebuilderNish Nishant12-May-02 21:26 
GeneralRe: adgHANDLE_DLGMSG??? Pin
NicholasCougar12-May-02 21:39
NicholasCougar12-May-02 21:39 
GeneralRe: adgHANDLE_DLGMSG??? Pin
Nish Nishant12-May-02 21:48
sitebuilderNish Nishant12-May-02 21:48 
GeneralRe: adgHANDLE_DLGMSG??? Pin
NicholasCougar12-May-02 22:04
NicholasCougar12-May-02 22:04 
GeneralWM_MOUSEWHEEL scroll only one line Pin
12-May-02 20:15
suss12-May-02 20:15 
GeneralRe: WM_MOUSEWHEEL scroll only one line Pin
12-May-02 22:53
suss12-May-02 22:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.