|
|
|
Помогите разобраться с ошибкой
|
|||
|---|---|---|---|
|
#18+
при запуске программы появляется табличка Debug Assertion Failed! Program: ................... .exe File: wingdi.cpp Line: 1120 подскажите, пожалуйста, в чем может быть ошибка ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 23.04.2007, 18:14 |
|
||
|
Помогите разобраться с ошибкой
|
|||
|---|---|---|---|
|
#18+
STORMY STEEL пишет: > при запуске программы появляется табличка > > Debug Assertion Failed! > Program: ................... .exe > File: wingdi.cpp > Line: 1120 > подскажите, пожалуйста, в чем может быть ошибка Ашипка может быть в этой самой программе. Posted via ActualForum NNTP Server 1.4 ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 23.04.2007, 19:11 |
|
||
|
Помогите разобраться с ошибкой
|
|||
|---|---|---|---|
|
#18+
#include <iomanip.h> #include <math.h> #include <stdlib.h> #include <time.h> ///////////////////////////////////////////////////////////////////////////////////////////////// int X[300], Y[300], a, b, c, d, e, f, g, h, i; CRgn rgn; void creation() { CPoint ptVertex[3]; ptVertex[0].x = a; ptVertex[0].y = b; ptVertex[1].x = c; ptVertex[1].y = d; ptVertex[2].x = e; ptVertex[2].y = f; rgn.CreatePolygonRgn( ptVertex, 3, ALTERNATE); } void selection() { if ( rgn.PtInRegion ( X , Y ) ) { g=g+1; } else { h=h+1; } } ///////////////////////////////////////////////////////////////////////////////////////////////// void CKursovayaDlg::OnPaint() { if (IsIconic()) { CPaintDC dc(this); // device context for painting SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0); // Center icon in client rectangle int cxIcon = GetSystemMetrics(SM_CXICON); int cyIcon = GetSystemMetrics(SM_CYICON); CRect rect; GetClientRect(&rect); int x = (rect.Width() - cxIcon + 1) / 2; int y = (rect.Height() - cyIcon + 1) / 2; // Draw the icon dc.DrawIcon(x, y, m_hIcon); } else { CDialog::OnPaint(); } ///////////////////////////////////////////////////////////////////////////////////////////////// int z=0, g1=0, g2=0, g3=0; srand(time(NULL)); g1=rand() %300; do { g2=rand() %300; } while (g2==g1); do { g3=rand() %300; } while( (g3==g2) || (g3==g1) ); do { if (z==0) { z=1; g=-1; h=1; for (i=0; i<300; i++) { X=rand() %550; Y=rand() %370; if (i==g1) { a=X; b=Y; } if (i==g2) { c=X; d=Y; } if (i==g3) { e=X; f=Y; } creation(); selection(); CClientDC dc(this); dc.SetPixel(X, Y, RGB(rand() %255, rand() %255, rand() %255)); } } else { g=-1; h=1; g1=rand() %300; a=X[g1]; b=Y[g1]; do { g2=rand() %300; } while (g2==g1); c=X[g2]; d=Y[g2]; do { g3=rand() %300; } while( (g3==g2) || (g3==g1) ); e=X[g3]; f=Y[g3]; creation(); for (i=0; i<300; i++) { selection(); } } } while (fabs(g-h)!=1); CClientDC dc(this); // dc.MoveTo(a, b); // dc.LineTo(c, d); // dc.LineTo(e, f); // dc.LineTo(a, b); CRect rectRgnBox; int nRgnBoxResult = rgn.GetRgnBox( &rectRgnBox ); ASSERT( nRgnBoxResult != ERROR || nRgnBoxResult != NULLREGION ); CBrush br; br.CreateSolidBrush( RGB(rand() %255, rand() %255, rand() %255) ); dc.FrameRgn( &rgn, &br, 1, 1 ); rgn.DeleteObject(); ///////////////////////////////////////////////////////////////////////////////////////////////// } ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 23.04.2007, 19:14 |
|
||
|
Помогите разобраться с ошибкой
|
|||
|---|---|---|---|
|
#18+
Из всего что ты показал ASSERT всего один, на нем и сыпется ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 23.04.2007, 20:13 |
|
||
|
Помогите разобраться с ошибкой
|
|||
|---|---|---|---|
|
#18+
если его убрать, тоже самое ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 23.04.2007, 20:19 |
|
||
|
|

start [/forum/topic.php?fid=57&msg=34481767&tid=2028987]: |
0ms |
get settings: |
7ms |
get forum list: |
19ms |
check forum access: |
3ms |
check topic access: |
3ms |
track hit: |
33ms |
get topic data: |
11ms |
get forum data: |
2ms |
get page messages: |
58ms |
get tp. blocked users: |
1ms |
| others: | 212ms |
| total: | 349ms |

| 0 / 0 |
