Jump to content
Software FX Community

Crash using windows API call to draw on chart


User (Legacy)
 Share

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...