Click here to Skip to main content
15,867,453 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi all,

I am doing an MFC Dialog based project in which i need to take text input user,
after searching on net I found this article VB Like InputBox for MFC[^] and using CInputBox class.
Now the problem is I want to wait and do nothing in application till the user has entered the text,then use the string the user has entered.(Now the other threads will be running though the user is busy entering the data)
How can I do it this way.
Please help,
Thanks in advance.
Posted
Updated 12-Apr-19 18:18pm
Comments
Sergey Alexandrovich Kryukov 8-Jul-11 3:12am    
OK, look what are you writing?! If this is MFC, it cannot be C++/CLI.
--SA
Sergey Alexandrovich Kryukov 8-Jul-11 3:16am    
So, do you need threads to pause at them moment of showing the dialog. This is some problem of the method as pausing thread is considered deprecated. However, it depends on what threads really do. Do they have a working cycle which is frequent enough? If you answer, I might provide a better advice.
--SA
hakz.code 11-Jul-11 8:47am    
Hi SA,sorry for the late reply(as I had to write hell lot of code),I did it by suspending the thread and resuming it later,one thread will be streaming and displaying data from a camera and when user clicks on a button the event handler for that butten will ask for the text using the input box,so before asking for the input i'll suspend the thread and will resume it as soon as I get the text from the user,please suggest if there are better ways.

1 solution

You have several options:
1. You can capture the text when it is entered, character after character. Then when the entered text reaches a certain size, or a certain character is pressed (i.e. "Enter"), you respond.
See this article[^].

2. You can add a button next to the text box, which is pressed by the user when the input is completed.
 
Share this answer
 
Comments
Richard MacCutchan 13-Apr-19 3:16am    
Look at the date of this question.
Michael Haephrati 13-Apr-19 22:02pm    
Unless this question is outdated and irrelevant to today's technologies (in such case, should be deleted), there is no reason why not to answer it. It is better appeared here with an answer than without one.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900