| |

VerySource

 Forgot password?
 Register
Search
View: 793|Reply: 5

Edit box in dialog box cannot return data in single document view with split view

[Copy link]

1

Threads

8

Posts

8.00

Credits

Newbie

Rank: 1

Credits
8.00

 China

Post time: 2020-2-1 02:00:01
| Show all posts |Read mode
I used VC to build a single document application with a split bar, and used the wizard to create a dialog class CFindDlg, and set an edit box on the dialog box to enter a string, and the corresponding member variable of the edit box is CString M_find of the class,
    A button is set on the toolbar, and the message processing is set in the CMyView class, which is used to click the pop-up dialog box
void CMyView :: OnButton32771 () // Message processing function
{
CFindDlg m_FindDlg;
m_FindDlg.DoModal // DoModal is used to create a modal dialog box
m_FindDlg.m_find; // m_find cannot return the edit box data in the dialog box
}

    If the message processing function is set in the main frame CMainFrame class, or in the single document program CMyView class without splitter, there is no problem. My problem is that if the message processing function is set in the CMyView class of my program, m_find cannot I received the data in the edit box.Why? If you want to study, you can provide a program.
Reply

Use magic Report

0

Threads

59

Posts

43.00

Credits

Newbie

Rank: 1

Credits
43.00

 China

Post time: 2020-3-13 21:30:01
| Show all posts
CFindDlg m_FindDlg;
m_FindDlg.DoModal // will not execute until the next statement before this dialog exits
m_FindDlg.m_find;
Reply

Use magic Report

1

Threads

8

Posts

8.00

Credits

Newbie

Rank: 1

Credits
8.00

 China

 Author| Post time: 2020-3-17 18:30:01
| Show all posts
Reply to2511718:

m_FindDlg.DoModal // When executed, a dialog box will pop up. I enter the string and press OK to exit the dialog box.
m_FindDlg.m_find; // Set breakpoint here to see if there is no data

Reply to wenbaby (雯贝贝):
The program will be sent to your email now, help me debug and see if there is any problem, thank you first
Reply

Use magic Report

0

Threads

59

Posts

43.00

Credits

Newbie

Rank: 1

Credits
43.00

 China

Post time: 2020-3-18 16:30:02
| Show all posts
That is the problem with your code
Reply

Use magic Report

1

Threads

8

Posts

8.00

Credits

Newbie

Rank: 1

Credits
8.00

 China

 Author| Post time: 2020-3-20 14:30:01
| Show all posts
2511718:

I set the same message processing function in the CMainFrame class of the main frame.
Reply

Use magic Report

1

Threads

8

Posts

8.00

Credits

Newbie

Rank: 1

Credits
8.00

 China

 Author| Post time: 2020-5-16 23:45:04
| Show all posts
The reason is roughly found:
    Deleted my previous debugging directory Debug, it is normal, it should be that the debug file generated before adding the dialog box has an impact on the debugging after adding the dialog box.
    Therefore, when solving programming problems that arise, if you repeatedly check that your code has no problems, you should expand your thinking to solve the problem.
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list