Click here to Skip to main content
14,605,006 members
   

C#

 
GeneralRe: How can I open a System.Windows.Forms.Form with its own message pump from a WPF application? Pin
arnold_w4-May-20 10:16
Memberarnold_w4-May-20 10:16 
GeneralRe: How can I open a System.Windows.Forms.Form with its own message pump from a WPF application? Pin
Richard Andrew x644-May-20 10:20
professionalRichard Andrew x644-May-20 10:20 
GeneralRe: How can I open a System.Windows.Forms.Form with its own message pump from a WPF application? Pin
arnold_w4-May-20 10:24
Memberarnold_w4-May-20 10:24 
GeneralRe: How can I open a System.Windows.Forms.Form with its own message pump from a WPF application? Pin
Richard Andrew x644-May-20 10:25
professionalRichard Andrew x644-May-20 10:25 
GeneralRe: How can I open a System.Windows.Forms.Form with its own message pump from a WPF application? Pin
arnold_w4-May-20 10:36
Memberarnold_w4-May-20 10:36 
GeneralRe: How can I open a System.Windows.Forms.Form with its own message pump from a WPF application? Pin
Richard Andrew x644-May-20 11:48
professionalRichard Andrew x644-May-20 11:48 
GeneralRe: How can I open a System.Windows.Forms.Form with its own message pump from a WPF application? Pin
arnold_w4-May-20 21:12
Memberarnold_w4-May-20 21:12 
GeneralRe: How can I open a System.Windows.Forms.Form with its own message pump from a WPF application? Pin
arnold_w4-May-20 22:30
Memberarnold_w4-May-20 22:30 
I just tried the following, but I got a runtime exception (System.InvalidOperationException: 'Cannot create more than one System.Windows.Application instance in the same AppDomain.')
System.Threading.Thread myThread = new System.Threading.Thread(delegate ()
{
    System.Windows.Forms.Form childFormWithItsOwnMsgPump = new System.Windows.Forms.Form();
    childFormWithItsOwnMsgPump.TopLevel = false;
    System.Windows.Forms.Integration.WindowsFormsHost host =
        new System.Windows.Forms.Integration.WindowsFormsHost();
    host.Child = childFormWithItsOwnMsgPump;
    System.Windows.Window WPFwindow = new System.Windows.Window();
    System.Windows.Application app = new System.Windows.Application();
    app.Run(WPFwindow);
});
myThread.SetApartmentState(System.Threading.ApartmentState.STA);
myThread.Start();
Suggestions are still welcome and very much appreciated.
GeneralRe: How can I open a System.Windows.Forms.Form with its own message pump from a WPF application? Pin
Richard MacCutchan4-May-20 22:59
mveRichard MacCutchan4-May-20 22:59 
GeneralRe: How can I open a System.Windows.Forms.Form with its own message pump from a WPF application? Pin
Richard Andrew x645-May-20 13:31
professionalRichard Andrew x645-May-20 13:31 
GeneralRe: How can I open a System.Windows.Forms.Form with its own message pump from a WPF application? Pin
Richard Andrew x644-May-20 10:35
professionalRichard Andrew x644-May-20 10:35 
AnswerRe: How can I open a System.Windows.Forms.Form with its own message pump from a WPF application? Pin
Gerry Schmitz4-May-20 14:07
mveGerry Schmitz4-May-20 14:07 
AnswerRe: How can I open a System.Windows.Forms.Form with its own message pump from a WPF application? Pin
arnold_w8-May-20 4:56
Memberarnold_w8-May-20 4:56 
QuestionC# Service to gather information from SQL Pin
Member 119552454-May-20 3:13
MemberMember 119552454-May-20 3:13 
AnswerRe: C# Service to gather information from SQL Pin
CHill604-May-20 3:15
mveCHill604-May-20 3:15 
AnswerRe: C# Service to gather information from SQL Pin
BillWoodruff4-May-20 5:08
mveBillWoodruff4-May-20 5:08 
AnswerRe: C# Service to gather information from SQL Pin
Gerry Schmitz4-May-20 14:53
mveGerry Schmitz4-May-20 14:53 
QuestionEnable Security to Excel generated with closexml Pin
AmitChaurasiya4-May-20 0:05
MemberAmitChaurasiya4-May-20 0:05 
AnswerRe: Enable Security to Excel generated with closexml Pin
Gerry Schmitz4-May-20 14:58
mveGerry Schmitz4-May-20 14:58 
GeneralRe: Enable Security to Excel generated with closexml Pin
Mycroft Holmes4-May-20 21:49
professionalMycroft Holmes4-May-20 21:49 
GeneralRe: Enable Security to Excel generated with closexml Pin
AmitChaurasiya5-May-20 21:11
MemberAmitChaurasiya5-May-20 21:11 
AnswerRe: Enable Security to Excel generated with closexml Pin
Richard Deeming5-May-20 1:27
mveRichard Deeming5-May-20 1:27 
GeneralRe: Enable Security to Excel generated with closexml Pin
AmitChaurasiya5-May-20 14:44
MemberAmitChaurasiya5-May-20 14:44 
QuestionHow to capture (read) feedback data from games in C# or C++ ( like vibration, force feedback, gunshot, explosion) Pin
Member 113408333-May-20 21:53
MemberMember 113408333-May-20 21:53 
AnswerRe: How to capture feedback data from games ( like vibration, force feedback, gunshot, explosion) Pin
Pete O'Hanlon3-May-20 21:02
subeditorPete O'Hanlon3-May-20 21:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.