Jump to content
Software FX Community

Crash using windows API call to draw on chart


User (Legacy)

Recommended Posts

Hi,

I have a specific set of data which, when plotted to Chart Looks fine.

However, only this set of data causes a crash when I use the PaintInfo

method to get the chart DC and then do some line drawing on the chart. This

code has worked for over 2 years, and now this one set of code is causing

the crash. The basics of the code look like:

' Select our clipping region, so when we draw we only

' draw inside the chart, and not on the border

hRegion = GetChartHRegion()

ChartDC = m_Chart.PaintInfo(CPI_GETDC)

result = SelectClipRgn(ChartDC, hRegion)

' Draw the first crosshair

m_Chart.ValueToPixel XData(P1), YData(P1), px, py, AXIS_Y

MoveTo ChartDC, px - 7, py

Regardless of what points I select from the data, the result is always the

same. Basically there is an access violation somewhere after the system

enters the call to MoveTo...

Any ideas as to how to work around this or troubleshoot?

Thanks,

Abe Krebs

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...