J
JB
Hi All,
I have a form (CFormMain) with a button. When I click the button, I
call a remote server that performs some action and sometimes notifies
back the client by displaying a custom message box (The custom message
box is just another form displayed via a ShowDialog). I'd like to make
my CFormMain form the owner of my message box, but when I specify it
as the owner in the ShowDialog, I get an exception "Cross-thread
operation not valid: Control 'CFormMain' accessed from a thread other
than the thread it was created on."
I understand the Message Box form is created in another thread, so I
tried to use Invoke, but didn't get much luck. Is what I'm trying to
do possible at all?
Thanks
JB
I have a form (CFormMain) with a button. When I click the button, I
call a remote server that performs some action and sometimes notifies
back the client by displaying a custom message box (The custom message
box is just another form displayed via a ShowDialog). I'd like to make
my CFormMain form the owner of my message box, but when I specify it
as the owner in the ShowDialog, I get an exception "Cross-thread
operation not valid: Control 'CFormMain' accessed from a thread other
than the thread it was created on."
I understand the Message Box form is created in another thread, so I
tried to use Invoke, but didn't get much luck. Is what I'm trying to
do possible at all?
Thanks
JB