CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 15 of 29

Threaded View

  1. #12
    Join Date
    Jan 2016
    Posts
    61

    Re: pass variable value from one dialogbox to other/ one class to other class in vc++

    Quote Originally Posted by GCDEF View Post
    There's nothing magic about dialog boxes. You pass variables around the same way you do with any other objects. You can write set and get methods or if it's public, just set the member directly.

    CMyDialog dlg;
    dlg.m_intVariable = 7;

    What's the confusion?

    in CMyDialog1 class file:
    m_intVariable =7;

    and in CMyDialog2 class file:
    int value;
    CMyDialog1 dlg;
    value= dlg.m_intVariable ;

    if we do not call DoModal method before assignment then dlg.m_intVariable is empty.
    Last edited by [email protected]; January 17th, 2016 at 07:32 AM.

Tags for this Thread

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