⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 subject_61710.htm

📁 vc
💻 HTM
字号:
<p>
序号:61710 发表者:tlmcasper 发表日期:2003-11-21 11:27:07
<br>主题:关于VC的一个问题,描述得应该很详细了吧
<br>内容:在建立的单文档工程View类的onDraw函数里添加如下代码,主要目的是验证(5,5)这个点是不是在point点坐标组构成的多边形内,如果是的话弹出对话框。<BR>CPoint point[3];<BR>CRgn m_Rgn;<BR>POINT Point;<BR><BR>point[0].x=0;point[0].y=0;<BR>point[1].x=10;point[1].y=10;<BR>point[2].x=20;point[2].y=0;<BR>m_Rgn.CreatePolygonRgn(point,3,0);<BR>Point.x=5;Point.y=5;<BR>if(m_Rgn.PtInRegion(Point.x,Point.y))<BR>&nbsp;&nbsp;&nbsp;&nbsp;MessageBox(&#34;点在建立的多边形区域内&#34;);<BR><BR>编译的时候没有错误,可是执行的时候弹出对话框提示:<BR>Debug Assertion Failed!<BR>Program:H:\test\Debug\test.exe<BR>File:afxwin1.inl<BR>Line:503<BR><BR>For information on how your program can cause an assertion failure,see the Visual C++ documentation on asserts<BR><BR>(Press Retry to debug the application)<BR>下面有终止、重试、忽略,三个按钮<BR>点击重试按钮,程序停在下面代码上<BR>==&gt;77FA144B&nbsp;&nbsp; int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3<BR>&nbsp;&nbsp; 77FA144C&nbsp;&nbsp; ret<BR>&nbsp;&nbsp; 77FA144D&nbsp;&nbsp; int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3<BR>&nbsp;&nbsp; 77FA144E&nbsp;&nbsp; ret<BR>&nbsp;&nbsp; 77FA144F&nbsp;&nbsp; mov&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; eax,dword ptr [esp+4]<BR>&nbsp;&nbsp; 77FA1453&nbsp;&nbsp; int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3<BR>&nbsp;&nbsp; 77FA1454&nbsp;&nbsp; ret&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4<BR>&nbsp;&nbsp; 77FA1457&nbsp;&nbsp; mov&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; eax,dword ptr [ebp-14h]<BR>&nbsp;&nbsp; 77FA145A&nbsp;&nbsp; mov&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; eax,dword ptr [eax]<BR>&nbsp;&nbsp; 77FA145C&nbsp;&nbsp; mov&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; eax,dword ptr [eax]<BR>&nbsp;&nbsp; 77FA145E&nbsp;&nbsp; mov&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dword ptr [ebp-280h],eax<BR>&nbsp;&nbsp; 77FA1464&nbsp;&nbsp; push&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1<BR>&nbsp;&nbsp; 77FA1466&nbsp;&nbsp; pop&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; eax<BR>&nbsp;&nbsp; 77FA1467&nbsp;&nbsp; ret<BR>&nbsp;&nbsp; …………………………………………<BR><BR>跟踪到上面提到的afxwin1.inl的503行,为如下内容:<BR>_AFXWIN_INLINE BOOL CRgn::PtInRegion(int x, int y) const<BR>==&gt;&nbsp;&nbsp;&nbsp;&nbsp;{ ASSERT(m_hObject != NULL); return ::PtInRegion((HRGN)m_hObject, x, y); }<BR><BR>输出窗口为如下内容:<BR>Loaded 'C:\WINNT\system32\ntdll.dll', no matching symbolic information found.<BR>Loaded symbols for 'C:\WINNT\system32\MFC42D.DLL'<BR>Loaded symbols for 'C:\WINNT\system32\MSVCRTD.DLL'<BR>Loaded 'C:\WINNT\system32\KERNEL32.DLL', no matching symbolic information found.<BR>Loaded 'C:\WINNT\system32\GDI32.DLL', no matching symbolic information found.<BR>Loaded 'C:\WINNT\system32\USER32.DLL', no matching symbolic information found.<BR>Loaded symbols for 'C:\WINNT\system32\MFCO42D.DLL'<BR>Loaded 'C:\WINNT\system32\imm32.dll', no matching symbolic information found.<BR>Loaded 'C:\WINNT\system32\ADVAPI32.DLL', no matching symbolic information found.<BR>Loaded 'C:\WINNT\system32\rpcrt4.dll', no matching symbolic information found.<BR>Loaded 'C:\WINNT\system32\mfc42loc.dll', no matching symbolic information found.<BR>Loaded 'D:\Program Files\Real\RealOne Player\rpplugins\rpms3260.dll', no matching symbolic information found.<BR>Loaded 'C:\WINNT\system32\pncrt.dll', no matching symbolic information found.<BR>Loaded 'C:\WINNT\system32\indicdll.dll', no matching symbolic information found.<BR>Loaded 'C:\WINNT\system32\COMCTL32.DLL', no matching symbolic information found.<BR>The program 'H:\MY DOCUMENTS\VCSAVE\test\Debug\test.exe' has exited with code 0 (0x0).<BR><BR><BR>请问这是什么问题,怎么解决?谢了先
<br><a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p>
<hr size=1>
<blockquote><p>
<font color=red>答案被接受</font><br>回复者:视频新手 回复日期:2003-11-21 11:59:20
<br>内容:m_Rgn.CreatePolygonRgn(point,3,0);<BR>改为<BR>m_Rgn.CreatePolygonRgn(point,3,ALTERNATE);
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -