Simultaneous execution of main and thread (containing a form)  in Borland C++

Posted on 2011-10-13
Last Modified: 2013-11-17

This seem like a tricky situation, but I'm not much of a Thread programmer. I have a Borland C++ program where the main form has an OnMessage handler that performs additional form navigation, mostly processing the ENTER key as TAB key. The main form creates a 2nd form that runs concurrently with the 1st form. Before the OnMessage function I could click either form and get control in that form. After the OnMessage handler was written I was locked on one form.

I got the bright idea of executing the 2nd form in a thread. Execution is fine, but the 2nd form never appears since, once again, I'm assuming the main form never gives up control. What I need is to be able to have the main form create the 2nd form and gain control of either by simply clicking one or the other of the forms. A Thread solution or a non-Thread solution is fine with me.

Any ideas?

Question by:flins
    LVL 45

    Accepted Solution

    Hi flins,

    You'll need to call one of the form's show methods (ShowModal, etc.) to display the form.

    This looks to be a predominantly Borland IDE question so I'm going to add that zone to the question.


    Author Comment


    I'm going to try that before accepting.

    I can't find Borland IDE in the zones? Where exactly is that? I must be going blind. You're not the
    first to correct me on that.


    Author Closing Comment

    This works great and without a thread Also, very quick to respond.

    LVL 45

    Expert Comment

    Hi flins,

    The Borland C++ zone is Programming / C / IDEs / C++ Builder.


    Author Comment

    Great! I'll log that zone in my notes since most of my questions will most likely fall under that category.



    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode ( They will have you believe that Unicode requires you to useā€¦
    A short article about problems I had with the new location API and permissions in Marshmallow
    The goal of this video is to provide viewers with basic examples to understand opening and writing to files in the C programming language.
    Video by: Grant
    The goal of this video is to provide viewers with basic examples to understand and use while-loops in the C programming language.

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now