How to handle An Invalid Thread Access Exception? [message #443115] |
Sat, 18 September 2004 21:18 |
Eclipse User |
|
|
|
Originally posted by: bharh.cc.gatech.edu
Hello,
I might have posted this message earlier, but since I cannot see it in the
newsgroup I am posting it again. Sorry if you see the same message twice.
I have been trying to understand what is the reason and how to handle
invalid thread access exception, but have had no luck.
I am calling a function from one plug-in to another plug-in (both the
plug-ins are running at the same time and one is dependent on another).
However, when I call the function it gives me Invalid Thread access
exception. This is what I am doing in my function:
Display display = new Display();
Shell shell = new Shell(display);
GridLayout gridLayout = new GridLayout();
gridLayout.numColumns = 3;
shell.setLayout(gridLayout);
...
//add buttons to the layout
...
shell.pack();
shell.open():
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) display.sleep();
}
I am not sure where the error occurs, but I believe it is right when I am
trying to create new Display. I have tried using syncExec and asyncExec
but I guess I don't know how to use them correctly because they are not
working either.
Could anyone please provide me or guide me to a concrete example that will
tell me how exactly to make this work.
Thanking you in advance,
Bharti Agarwal
|
|
|
|
Powered by
FUDForum. Page generated in 0.03771 seconds