TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
geo zhou
NA
3
0
How to call a DLL with message loop
Mar 27 2007 6:05 PM
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!
Reply
Answers (
2
)
Chat Server
Run time error on one machine.