OCX wrapper and printing
Mark Williamson -- mwilliam@piresearch.co.uk
Wednesday, May 29, 1996
Using Windows 95 , 4.1 (subscription update (ie. the second 4.1 they sent 
out))
I'm just trying to knock out a small app that lets me graph coverage 
information from a set of radio receivers. The data is displayed using the 
BPS Graph OCX on a CFormView. This part works fine.
When I come to print the form ( I have called all the appropriate bits of 
CView and routed the commands from the menus) the OCX graphs won't print. 
The OCX wrapper class has a function called SetPrintInfo one of the values 
of which is the HDC. However this is a short not a class HDC__ *. I cast 
the hdc to a void * and then a short and it all compiles and runs fine 
except there is no output. The OCX can print itself and my text that I add 
during OnPrint all prints  ok. I guess the problem might be that the OCX 
wrapper class (which I presume the developer studio builds? ) is forcing 
the HDC to be a short and throwing information away..
any ideas
mark
David.Lowndes@bj.co.uk
Monday, June 03, 1996
> The OCX wrapper class has a function called SetPrintInfo one of the values 
of which is the HDC. However this is a short not a class HDC__ *. I cast 
the hdc to a void * and then a short and it all compiles and runs fine 
except there is no output.
<
mark,
I think you should be using CDC::GetSafeHdc() to return the HDC. Type
casting will just fiddle the value of CDC which isn't the same thing at all.
Dave Lowndes
 
  
   
     
  | Вернуться в корень Архива
  |