This documentation is archived and is not being maintained.

Application.OleRequired Method

Initializes OLE on the current thread.

[Visual Basic]
Public Shared Function OleRequired() As ApartmentState
public static ApartmentState OleRequired();
public: static ApartmentState OleRequired();
public static function OleRequired() : ApartmentState;

Return Value

One of the ApartmentState values.


Call this method before calling any Microsoft.Win32 method that requires OLE. OleRequired first checks to see if OLE has been initialized on the current thread. If not, it initializes the thread for OLE.

Note   Unless a thread calls OLE methods directly, you do not need to call this method.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

Application Class | Application Members | System.Windows.Forms Namespace