What function fills DPLOT_PLOTMETRICS structure?

Q&A for C, C++, and/or C# developers using DPlot
Post Reply
rkm
Posts: 27
Joined: Wed Nov 21, 2012 11:15 am

What function fills DPLOT_PLOTMETRICS structure?

Post by rkm »

I have been using DPLOTLIB.LIB to create a dialog box to display a variety of plots from a data set. The dialog is based on CTEST2.C and during most of the development has been successfully handling the WM_MOUSEMOVE messages. As the capability of the dialog expands, so does the code so it is now well over 2K lines. After one new code iteration the mouse-movement mapping display suddenly stopped working. The debugger showed the cause to be that all the members of the DPLOT_PLOTMETRICS structure DPM (except the size) were zero at the time the WM_MOUSEMOVE message is processed. The result is that the cursor position is always found to lie outside the plot rectangle region defined by DPM.hll, DPM.hur, DPM.vur and DPM.vll and thus writes an empty string to the control where the coordinates are displayed.

My question is what function is responsible for filling in the values in the DPM structure? Is it DPlot_GetBitmapEx()?.

-rob
User avatar
DPlotAdmin
Posts: 2312
Joined: Tue Jun 24, 2003 9:34 pm
Location: Vicksburg, Mississippi
Contact:

Post by DPlotAdmin »

My question is what function is responsible for filling in the values in the DPM structure? Is it DPlot_GetBitmapEx()?.
Yes.

You'll want to make sure that DPM is static. Other than that I'm not sure what might be going wrong with a call to DPlot_GetBitmapEx. If this is no help you may want to try DPlot_SetErrorMethod(2) to display dplotlib errors in a MessageBox.
Last edited by DPlotAdmin on Mon Dec 17, 2012 5:42 pm, edited 1 time in total.
Visualize Your Data
support@dplot.com
rkm
Posts: 27
Joined: Wed Nov 21, 2012 11:15 am

Post by rkm »

Thanks. At least I know I'm looking in the right place.

The structure is static.
DPlot_SetErrorMethod(2) is being used and does not report any error.
DPlot_GetBitmapEx() is returning what appears to be a valid bitmap handle.
The bitmap handle changes each time the same data set is replotted (which I assume is normal).
The plot is being properly displayed in the intended dialog control.

BUT
I just noticed that the DocNum is not being changed on successive plots of the same quantities, might be a clue?

Will report back if and when I locate the problem.

-rob
User avatar
DPlotAdmin
Posts: 2312
Joined: Tue Jun 24, 2003 9:34 pm
Location: Vicksburg, Mississippi
Contact:

Post by DPlotAdmin »

If DocNum isn't changing then the plot is being closed after creation. That's fine for 2D data, but for 3D data (whether plotted in 2D or 3D) you need to leave it open in DPlot. Otherwise you won't be able to interpolate Z given X and Y.
Visualize Your Data
support@dplot.com
Post Reply