<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7652.24">
<TITLE>Cairo error message on exit?</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->
<P><FONT SIZE=2> I'm just starting out using Cairo to replace some existing GDI/GDI+<BR>
code in Visual C++ 2010 and it seems to be working fine, but I'm getting<BR>
an error message each time I close down my application :<BR>
<BR>
"First-chance exception at 0x68e629dc in CairoTest.exe: 0xC0000005:<BR>
Access violation reading location 0xabababa7"<BR>
<BR>
This error only happens if I've called cairo_paint(cr) while the<BR>
application is running - if I comment this line out, it disappears. The<BR>
only Cairo code in my application so far is :<BR>
<BR>
CChildView::CChildView()<BR>
{<BR>
testsurface =<BR>
cairo_image_surface_create_from_png("BlackShinyBackground.png");<BR>
}<BR>
<BR>
CChildView::~CChildView()<BR>
{<BR>
cairo_surface_destroy(testsurface);<BR>
}<BR>
<BR>
void CChildView::OnPaint()<BR>
{<BR>
CPaintDC dc(this);<BR>
<BR>
cairo_surface_t *surface = cairo_win32_surface_create(dc.m_hDC);<BR>
cairo_t *cr = cairo_create (surface);<BR>
<BR>
cairo_set_source_surface(cr, testsurface, 0, 0);<BR>
cairo_paint(cr);<BR>
cairo_destroy (cr);<BR>
cairo_surface_destroy (surface);<BR>
}<BR>
<BR>
Can anybody point me in the direction of what I'm doing wrong? It's<BR>
probably something dumb, but I'd appreciate my ignorance being pointed out.<BR>
Thanks,<BR>
Dan<BR>
</FONT>
</P>
</BODY>
</HTML>