Click here to Skip to main content
15,911,715 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionhelp TRACE("message")? Pin
imran_rafique17-Sep-02 15:39
imran_rafique17-Sep-02 15:39 
AnswerRe: help TRACE("message")? Pin
Chris Losinger17-Sep-02 15:54
professionalChris Losinger17-Sep-02 15:54 
Questionwho to creat service? Pin
imran_rafique17-Sep-02 15:11
imran_rafique17-Sep-02 15:11 
Questionhow to know? Pin
imran_rafique17-Sep-02 15:00
imran_rafique17-Sep-02 15:00 
GeneralCRect different values ! Pin
nss17-Sep-02 14:55
nss17-Sep-02 14:55 
GeneralRe: CRect different values ! Pin
nss17-Sep-02 15:08
nss17-Sep-02 15:08 
Questionhelp? Pin
imran_rafique17-Sep-02 14:46
imran_rafique17-Sep-02 14:46 
GeneralCClientDC is transparent for CHtmlView. Pin
Jawache17-Sep-02 14:30
Jawache17-Sep-02 14:30 
Hi,

I'm trying to place a bitmap of the contents of my CHTMLView Derived class into the clipboard. But all I get when I paste the resulting bitmap is the VC++ IDE behind it.

Heres the code i'm using..

<code><font  face="Courier New"><font color="#000000">	<font color="#000080">CRect rect</font><font color="#808080">;
</font>	<font color="#000080">GetClientRect</font><font color="#808080">(</font><font color="#000080">rect</font><font color="#808080">);
</font>	<font color="#000080">rect</font><font color="#808080">.</font><font color="#000080">NormalizeRect</font><font color="#808080">();
</font>	<font color="#0000FF">if</font><font color="#808080">(</font><font color="#000080">rect</font><font color="#808080">.</font><font color="#000080">IsRectEmpty</font><font color="#808080">() || </font><font color="#000080">rect</font><font color="#808080">.</font><font color="#000080">IsRectNull</font><font color="#808080">())
</font>		<font color="#0000FF">return </font><font color="#FF0000">0L</font><font color="#808080">;
</font>	<font color="#000080">CClientDC dcScrn</font><font color="#808080">(</font><font color="#0000FF">this</font><font color="#808080">);
</font>	<font color="#000080">CDC memDc</font><font color="#808080">;
</font>	<font color="#0000FF">if</font><font color="#808080">(!</font><font color="#000080">memDc</font><font color="#808080">.</font><font color="#000080">CreateCompatibleDC</font><font color="#808080">(&</font><font color="#000080">dcScrn</font><font color="#808080">))
</font>		<font color="#0000FF">return </font><font color="#FF0000">0L</font><font color="#808080">;
</font>	<font color="#000080">CBitmap bitmap</font><font color="#808080">;
</font>	<font color="#0000FF">if</font><font color="#808080">( !</font><font color="#000080">bitmap</font><font color="#808080">.</font><font color="#000080">CreateCompatibleBitmap</font><font color="#808080">(&</font><font color="#000080">dcScrn</font><font color="#808080">,</font><font color="#000080">rect</font><font color="#808080">.</font><font color="#000080">Width</font><font color="#808080">(),</font><font color="#000080">rect</font><font color="#808080">.</font><font color="#000080">Height</font><font color="#808080">()))
</font>		<font color="#0000FF">return </font><font color="#FF0000">0L</font><font color="#808080">;
</font>	<font color="#000080">CBitmap</font><font color="#808080">* </font><font color="#000080">pOldBitmap </font><font color="#808080">= </font><font color="#000080">memDc</font><font color="#808080">.</font><font color="#000080">SelectObject</font><font color="#808080">(&</font><font color="#000080">bitmap</font><font color="#808080">);
</font>	<font color="#000080">memDc</font><font color="#808080">.</font><font color="#000080">BitBlt</font><font color="#808080">(</font><font color="#FF0000">0</font><font color="#808080">,</font><font color="#FF0000">0</font><font color="#808080">,</font><font color="#000080">rect</font><font color="#808080">.</font><font color="#000080">Width</font><font color="#808080">(),</font><font color="#000080">rect</font><font color="#808080">.</font><font color="#000080">Height</font><font color="#808080">(),&</font><font color="#000080">dcScrn</font><font color="#808080">,</font><font color="#000080">rect</font><font color="#808080">.</font><font color="#000080">left </font><font color="#808080">,</font><font color="#000080">rect</font><font color="#808080">.</font><font color="#000080">top </font><font color="#808080">,
</font>	             <font color="#000080">SRCCOPY </font><font color="#808080">);
</font>	<font color="#0000FF">if</font><font color="#808080">(</font><font color="#000080">OpenClipboard</font><font color="#808080">())
</font>	<font color="#808080">{
</font>		<font color="#000080">EmptyClipboard</font><font color="#808080">();
</font>		<font color="#000080">SetClipboardData</font><font color="#808080">(</font><font color="#000080">CF_BITMAP</font><font color="#808080">,</font><font color="#000080">bitmap</font><font color="#808080">.</font><font color="#000080">GetSafeHandle</font><font color="#808080">());
</font>		<font color="#000080">CloseClipboard</font><font color="#808080">();
</font>	<font color="#808080">}
</font>	<font color="#000080">memDc</font><font color="#808080">.</font><font color="#000080">SelectObject</font><font color="#808080">(</font><font color="#000080">pOldBitmap</font><font color="#808080">);
</font>	<font color="#0000FF">return </font><font color="#FF0000">1l</font><font color="#808080">;
</font></font>
</code>


I'm learning DC and painting functions as i'm going any help would be appreciated.

Thanks

Asim Hussain
e: asim@jawache.net
w: www.jawache.net
GeneralRe: CClientDC is transparent for CHtmlView. Pin
.dan.g.17-Sep-02 17:00
professional.dan.g.17-Sep-02 17:00 
GeneralRe: CClientDC is transparent for CHtmlView. Pin
Jawache18-Sep-02 1:10
Jawache18-Sep-02 1:10 
Generalsocket server and client Pin
xai17-Sep-02 14:17
xai17-Sep-02 14:17 
GeneralRe: socket server and client Pin
Le centriste17-Sep-02 15:22
Le centriste17-Sep-02 15:22 
GeneralRe: socket server and client Pin
xai17-Sep-02 18:50
xai17-Sep-02 18:50 
GeneralRe: socket server and client Pin
Le centriste18-Sep-02 3:54
Le centriste18-Sep-02 3:54 
GeneralTAPI voice recording problems Pin
twomagiclovers17-Sep-02 12:05
twomagiclovers17-Sep-02 12:05 
GeneralPrinting on custom paper size Pin
huub17-Sep-02 11:04
huub17-Sep-02 11:04 
GeneralRe: Printing on custom paper size Pin
Ernest Laurentin17-Sep-02 12:12
Ernest Laurentin17-Sep-02 12:12 
GeneralBold text in Owner Draw ComboBox Pin
Aaron Schaefer17-Sep-02 9:51
Aaron Schaefer17-Sep-02 9:51 
GeneralRe: Bold text in Owner Draw ComboBox Pin
Paul M Watt17-Sep-02 17:02
mentorPaul M Watt17-Sep-02 17:02 
GeneralRe: Bold text in Owner Draw ComboBox Pin
.dan.g.17-Sep-02 17:06
professional.dan.g.17-Sep-02 17:06 
QuestionWhat do I need to create/compile a _UNICODE MFC application on Win 9x ? Pin
Ștefan-Mihai MOGA17-Sep-02 9:40
professionalȘtefan-Mihai MOGA17-Sep-02 9:40 
AnswerRe: What do I need to create/compile a _UNICODE MFC application on Win 9x ? Pin
Joaquín M López Muñoz17-Sep-02 9:56
Joaquín M López Muñoz17-Sep-02 9:56 
GeneralRe: What do I need to create/compile a _UNICODE MFC application on Win 9x ? Pin
Ștefan-Mihai MOGA17-Sep-02 10:07
professionalȘtefan-Mihai MOGA17-Sep-02 10:07 
Questionhow to get CRect of the total CformView, not just the visible portion? Pin
ns17-Sep-02 9:12
ns17-Sep-02 9:12 
AnswerRe: how to get CRect of the total CformView, not just the visible portion? Pin
Joaquín M López Muñoz17-Sep-02 9:19
Joaquín M López Muñoz17-Sep-02 9:19 

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.