What do the output values from CoGetApartmentType mean?

Raymond Chen

Raymond

The Co­Get­Apartment­Type function returns two pieces of information, documented as follows:

  • APT­TYPE enumeration value that specifies the type of the current apartment.
  • APT­TYPE­QUALIFIER enumeration value that specifies the type qualifier of the current apartment.

The possible combinations can be deduced from the documentation for APT­TYPE­QUALIFIER, but here they are in table form because people like tables.

Apartment TypeQualifierMeaning
STANONESingle-threaded apartment
MAINSTANONEMain single-threaded apartment
MTANONEMultithreaded apartment, explicitly initialized
MTAIMPLICITMultithreaded apartment, implicitly initialized
NANA_ON_STANeutral apartment entered on STA thread
NANA_ON_MAINSTANeutral apartment entered on main STA thread
NANA_ON_MTANeutral apartment entered on explicit MTA thread
NANA_ON_IMPLICIT_MTANeutral apartment entered on implicit MTA thread

More details can be found in the documentation for APT­TYPE­QUALIFIER.

Raymond Chen
Raymond Chen

Follow Raymond   

0 comments

Comments are closed.