Home > Net > C # winform call DLL affects the main thread after child form?
C # winform call DLL affects the main thread after child form?
Time:11-17
Need to use when writing winform procedure is a DLL that others have written form, often an error because the DLL has not been perfect, affect the main thread of my own, especially when the DLL error lead to my application die, try catch didn't also the way to solve, try a number of ways or not, think of the DLL in the child thread running, but I need to put the DLL form in my form, it needs to invoke, thus, in the main thread running call DLL code is as follows, the great god give a good idea ~
Form1 is the child in the DLL form, form the initialization will open some operation thread, panel1 is one of my main form panel
LCD=new _click (); LCD. The TopLevel=false; Panel1. Controls. The Add (LCD); LCD. The Dock=DockStyle. The Fill; LCD. The Show ();
CodePudding user response:
Form the ans can't,
I can only say that there didn't write well, you don't use, Isolation function we can use the process, the form? Don't struggle with double process off-screen drawing? If your brother has the ability to play double process off-screen drawing, you won't be asked this question, he would have solved
CodePudding user response:
Personal advice, he didn't write a good case, a single EXE encapsulation
We use a button with the process called independently, You must embed line, also called win32API, set the parent, the establishment, set the form style
CodePudding user response:
Thought of calling exe, but also need to call it function, dynamic assignment for him, also thought of dynamic write configuration files or heartbeat packets communication, always feel too much trouble, as saying