CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 1999
    Location
    Chennai, INDIA
    Posts
    27

    UpdateData() Error

    hi,
    i tried to call UpdateData function of Dialog box from its constructor and i got my favourite error "Assertion Failed". can't i call UpadateData function from the Constructor of the Dialog box. can any one explain this.

    Thanks in Advance,
    Kalyan


  2. #2
    Join Date
    May 1999
    Posts
    14

    Re: UpdateData() Error

    Hello!

    Calling member functions in a classes constructor usually causes an assertion failure, because i think the class has not yet been initialized completely. (Probably the constructors of the base-classes like CWnd etc. have to create the window first...)

    What you should do is to put your initilization code in the OnInitDialog or OnInitialUpdate message handler.

    Hope this helps.
    Best regards.
    Alan.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured