• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

How to mark / build C# / WPF component STA

I am hosting WPF components in unmanaged MFC. This WPF components will
do some ricktext editing. Hosting / editing are working fine but
closing will crash application on exit (release version only and no
crash on debug). The following is the current structure:

class parentA_COM : definited / implemented in unmanaged C++, STA
class memberB_COM : definited in unmanaged C++, but implemented in C#
class winUserControl: implemented in C# to host WPF user control;
class wpfUserControl: implemented in C#

class MyApp // unmanaged C++
main ()
parentA_COM pPA(); // Initialize COM component

class parentA_COM // unmanaged C++
void get_hWnd()

memberB_COM m_ipMB;

class memberB_COM : IDisposable, ... // C#
constuctor // initialize winUserControl

class winUserControl : UserControl
host WPF control wpfUserControl

How can I mark / make wpfUserControl / or winUserControl / or
memberB_COM STA? Thanks.

My Computer

Users Who Are Viewing This Thread (Users: 1, Guests: 0)