Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 825495
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T03:15:56+00:00 2026-05-15T03:15:56+00:00

How do I make extra initializations on a modal dialog before calling DoModal(); ?

  • 0

How do I make extra initializations on a modal dialog before calling DoModal(); ?

The whole application is created using VS wizards.
I have a main Dialog (the one that is created automatically when I select new MFC Application in Visual Studio 2008 Professional).
When I click a button on this dialog I want to open another dialog and set a CString value into a CEdit control.

my code:

...
void MainDlg::OnClickedButtonX(){
   SecondDialogClass Dlg2;
   Dlg2.asocVar2Cedit.SetWindowTextW(L"my text");
   Dlg2.DoModal();
}
//asocVar2Cedit is the associeted control variable to the 
//CEdit control on the second Dialog (Right Click > Add Variable..  in VSC++)
...

this code generates at runtime a “Debug Assertion” error in winocc…

Any ideas ?
Thank you in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T03:15:57+00:00Added an answer on May 15, 2026 at 3:15 am

    Add an OnInitDialog (WM_INITDIALOG) handler to your CDialog-derived class and have it initialise itself.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The admins for my application can make extra properties for the userprofiles. So UserA
I have created an application which needs 'hand-over' to the support group in the
I have a problem with SharedPrefences and initializations. My application has a login where
How can I make a Menu Extra like the Battery Meter in Cocoa? I
I need to add extra validation to my DateField in Admin to make sure
I understand how classes work and how to make them, but the 2nd extra
make /bin/sh /Users/myusername/Downloads/php-5.3.5/ext/mssql/libtool --mode=compile cc -I. -I/Users/myusername/Downloads/php-5.3.5/ext/mssql -DPHP_ATOM_INC -I/Users/myusername/Downloads/php-5.3.5/ext/mssql/include -I/Users/myusername/Downloads/php-5.3.5/ext/mssql/main -I/Users/myusername/Downloads/php-5.3.5/ext/mssql -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM
i make one class file for jar. and this class have use wurfl. and
I make an app that have to printing image. I need to print image
I have scrollbars using the jScrollPane plug-in for jQuery. The scrollbar works, all content

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.