Click here to Skip to main content
14,738,056 members
Home » Discussions » C#
   

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 11:16
Memberarnold_w4-May-20 11: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 11:20
professionalRichard Andrew x644-May-20 11: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 11:24
Memberarnold_w4-May-20 11: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 11:25
professionalRichard Andrew x644-May-20 11: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 11:36
Memberarnold_w4-May-20 11: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 12:48
professionalRichard Andrew x644-May-20 12: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 22:12
Memberarnold_w4-May-20 22: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 23:30
Memberarnold_w4-May-20 23: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 23:59
mveRichard MacCutchan4-May-20 23: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 14:31
professionalRichard Andrew x645-May-20 14: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 11:35
professionalRichard Andrew x644-May-20 11: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 15:07
mveGerry Schmitz4-May-20 15: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 5:56
Memberarnold_w8-May-20 5:56 
QuestionC# Service to gather information from SQL Pin
Member 119552454-May-20 4:13
MemberMember 119552454-May-20 4:13 
AnswerRe: C# Service to gather information from SQL Pin
CHill604-May-20 4:15
mveCHill604-May-20 4:15 
AnswerRe: C# Service to gather information from SQL Pin
BillWoodruff4-May-20 6:08
mveBillWoodruff4-May-20 6:08 
AnswerRe: C# Service to gather information from SQL Pin
Gerry Schmitz4-May-20 15:53
mveGerry Schmitz4-May-20 15:53 
QuestionEnable Security to Excel generated with closexml Pin
AmitChaurasiya4-May-20 1:05
MemberAmitChaurasiya4-May-20 1:05 
AnswerRe: Enable Security to Excel generated with closexml Pin
Gerry Schmitz4-May-20 15:58
mveGerry Schmitz4-May-20 15:58 
GeneralRe: Enable Security to Excel generated with closexml Pin
Mycroft Holmes4-May-20 22:49
professionalMycroft Holmes4-May-20 22:49 
GeneralRe: Enable Security to Excel generated with closexml Pin
AmitChaurasiya5-May-20 22:11
MemberAmitChaurasiya5-May-20 22:11 
AnswerRe: Enable Security to Excel generated with closexml Pin
Richard Deeming5-May-20 2:27
mveRichard Deeming5-May-20 2:27 
GeneralRe: Enable Security to Excel generated with closexml Pin
AmitChaurasiya5-May-20 15:44
MemberAmitChaurasiya5-May-20 15:44 
QuestionHow to capture (read) feedback data from games in C# or C++ ( like vibration, force feedback, gunshot, explosion) Pin
Member 113408333-May-20 22:53
MemberMember 113408333-May-20 22:53 
AnswerRe: How to capture feedback data from games ( like vibration, force feedback, gunshot, explosion) Pin
Pete O'Hanlon3-May-20 22:02
mvePete O'Hanlon3-May-20 22: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.