Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

accessing numberic edit variable causes ASSERT error

First, the debugger generates the "Property is read-only" warning message when the "GetParentFrame()->RecalcLayout();" line is executed in the void CTargetView::OnInitialUpdate() function. When the NI numeric control is removed from the window, the "Property is read-only" message disappears. See code below.

Further, when accessing the variables inserted by the ClassWizard for the Numeric Edit control, such as the "Control" variable associated with the Numeric Edit box, the program generates an exception breakpoint in WINOCC.CPP, line 360, in the void CWnd::GetProperty() function
ASSERT(m_pCtrlSite!=NULL). Is this a bug?


Thank you for any help you can provide.


void CTargetView::OnInitialUpdate() {
CFormV
iew::OnInitialUpdate();
GetParentFrame()->RecalcLayout();
ResizeParentToFit();
}
0 Kudos
Message 1 of 2
(3,531 Views)
Failing to assert (m_pCtrlSite != NULL) typically indicates a problem with the ActiveX control container support in the MFC form. Verify that you have a call to AfxEnableControlContainer at an appropriate point in your code. I tried and was unable to reproduce the behavior you are seeing.

Try to place other ActiveX controls or documents on your form to see if this is a general problem with ActiveX support in your application.

Did you use the National Instruments Measurement Studio AppWizard to create this project from scratch, did you use the 6.0 add-in to add Measurement Studio support to an existing project, or did you follow the 1.0 instructions on how to manually add Measurement Studio support to an existing project?

David Rohacek
National Instrume
nts
Message 2 of 2
(3,531 Views)