We help IT Professionals succeed at work.
Get Started

threads and dialogs

toskisen asked
Last Modified: 2010-04-02
I have a thread in wich a variable gets processed and set.
It's a client/server app. The ClientThread does the connection specific doings.

UINT  CAppDlg::ClientThread(LPVOID pParam)
 CustomClass classVar;
 [some processing on classVar]

classVar contains the socket (unimportant knowings).
Anyways, I want to open a modeless dialog and pass the variable classVar (the socket) to it so I can continue processing it (sending/recieving) from there.
You can't use .create .doModal etc. inside a thread.
And the dialog is not to be opened until the user clicks a button "Open" in the main dialog.

So, someone connects to the server, gets added to a list, the user selects the client, clicks Open and a new dialog is opened.
That dialog should know the socket.

How can I do that?


edit: btw, I'm using vc++ .NET 2k3
Watch Question
This problem has been solved!
Unlock 1 Answer and 6 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE