how to put a float from user input into GL_POLYGON?

i have a dialog that has a variable m_length of float type. When i tried to draw a polygon using this variable, i encounter assetion error, where is the problem?

void Dialog::OnOK()
{

UpdateData(TRUE);

float length=m_length;

CPaintDC dc(this);
glLoadIdentity();
glClear(GL_COLOR_BUFFER_BIT);

glBegin(GL_POLYGON);
glColor3ub(0,40,230);
glVertex2f(100.0f, 100.0f);
glColor3ub(0,40,230);
glVertex2f(100.0f, length);
glColor3ub(0,40,230);
glVertex2f(400.0f, length);
glColor3ub(0,40,230);
glVertex2f(400.0f, 100.0f);
glEnd();

glFlush();
CDialog::OnOK();

}

sorry i made a careless mistake, it is okie now