Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

cwdatagraph controlimage causes program to freeze

Hello,

In my program I have a graph that contains a few plots and several annotations. When I run the program, there are no issues with drawing this graph in the form. However, I am currently trying to add functionality to print this graph (and other graphs) to a report. It seems that whenever I call ControlImage  for this particular graph, the program freezes.

I have no trouble printing other graphs from the form, and like I said, there is no problem with displaying the problem graph on the form. I don't get any error messages, the program just freezes. I've tried 1) sending ControlImage directly to Printer.PaintPicture, (2) storing the image as a variable and then passing the variable to Printer.PaintPicture, and (3) storing the image to the clipboard and then passing it to Printer.PaintPicture. Before the ControlImage call I've also tried adding ImmediateUpdates = False, SetFocus, and Refresh.

I'm stuck as far as what's causing the problem. Are there any issues with ControlImage that I should be aware of? Is there another way to copy the graph to the printer?

Thanks,
Ian
0 Kudos
Message 1 of 2
(6,601 Views)
Hi Ian,

It's probably hanging because there is no call to Printer.EndDoc after you call Printer.Paintpicture. See this KB for more information.


Test Engineer - CTA
0 Kudos
Message 2 of 2
(6,587 Views)