Hi
I want to re-write a C# application(exe) to C# DLL. This application
starts by
myApp.MainApplication app = new myApp.MainApplication();
Application.Idle += new
EventHandler(app.myApp.OnApplicationIdle);
Application.Run(app);
But when I move all the code into a DLL and try to call the DLL from
a test program by
myApp.MainApplication.Main(args);
I got next error
"Starting a second message loop on a single thread is not a valid
operation. Use Form.ShowDialog instead."
I tried to change
Application.Run(app);
To
app.ShowDialog();
Error was gone but I can't get mouse event. Application was not
runing correctly.
I changed my test porgram
Application.Run(new form1());
to
Form myform = new Form1();
myform.ShowDialog();
Same error message was returned.
Anyone has any idea about it, or any related infomation is helpfull.
Thanks!
How to call a DLL with message loop
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Mike GoldRank #50 · 30.6K pointsPosted Mar 27, 2007, 8:43 PM EDT
Anyone else have any suggestions?
-Mike
geo zhou3 pointsPosted Mar 28, 2007, 10:06 AM EDT