Share via


IVsDataProvider.TryCreateObject Method

Definition

Overloads

TryCreateObject(Type)

Tries to create an instance of the specified DDEX support entity that is implemented by the DDEX provider.

TryCreateObject(Guid, Type)

Tries to create an instance of the specified DDEX support entity for the specified DDEX data source that is implemented by the DDEX provider.

TryCreateObject<TObject,TSite>(Guid, TSite)

Tries to create an instance of the specified DDEX support entity for the specified DDEX data source that is implemented by the DDEX provider, sited with the specified site object.

TryCreateObject<TObject>(Guid)

Tries to create an instance of the specified DDEX support entity for the specified DDEX data source that is implemented by the DDEX provider.

TryCreateObject<TObject>()

Tries to create an instance of the specified DDEX support entity that is implemented by the DDEX provider.

TryCreateObject<TSite>(Guid, Type, TSite)

Tries to create an instance of the specified DDEX support entity for the specified DDEX data source that is implemented by the DDEX provider, sited with the specified site object.

TryCreateObject(Type)

Tries to create an instance of the specified DDEX support entity that is implemented by the DDEX provider.

public:
 System::Object ^ TryCreateObject(Type ^ objType);
public object TryCreateObject (Type objType);
abstract member TryCreateObject : Type -> obj
Public Function TryCreateObject (objType As Type) As Object

Parameters

objType
Type

A type of DDEX support entity.

Returns

An instance of the specified DDEX support entity that is implemented by the DDEX provider, if the DDEX provider supports it; otherwise, null.

Exceptions

Instantiation of a new instance of the support entity threw an exception, whether by way of a CreateInstance call through reflection or through the DDEX provider’s CreateObject(Type) method implementation, or creation of the default or client object implementation (if there is one) failed.

Applies to

TryCreateObject(Guid, Type)

Tries to create an instance of the specified DDEX support entity for the specified DDEX data source that is implemented by the DDEX provider.

public:
 System::Object ^ TryCreateObject(Guid source, Type ^ objType);
public object TryCreateObject (Guid source, Type objType);
abstract member TryCreateObject : Guid * Type -> obj
Public Function TryCreateObject (source As Guid, objType As Type) As Object

Parameters

source
Guid

A DDEX data source identifier, or Empty for no specific data source.

objType
Type

A type of DDEX support entity.

Returns

An instance of the specified DDEX support entity for the specified DDEX data source that is implemented by the DDEX provider, if the DDEX provider supports it; otherwise, null.

Exceptions

Instantiation of a new instance of the support entity threw an exception, whether by way of a CreateInstance call through reflection or through the DDEX provider’s CreateObject(Guid, Type) or CreateObject(Type) method implementation, or creation of the default or client object implementation (if there is one) failed.

Applies to

TryCreateObject<TObject,TSite>(Guid, TSite)

Tries to create an instance of the specified DDEX support entity for the specified DDEX data source that is implemented by the DDEX provider, sited with the specified site object.

public:
generic <typename TObject, typename TSite>
 TObject TryCreateObject(Guid source, TSite site);
public TObject TryCreateObject<TObject,TSite> (Guid source, TSite site);
abstract member TryCreateObject : Guid * 'Site -> 'Object
Public Function TryCreateObject(Of TObject, TSite) (source As Guid, site As TSite) As TObject

Type Parameters

TObject

The object.

TSite

The site.

Parameters

source
Guid

A DDEX data source identifier, or Empty for no specific data source.

site
TSite

An instance of an object that should site the new DDEX support entity.

Returns

TObject

An instance of the specified DDEX support entity for the specified DDEX data source that is implemented by the DDEX provider, sited with the specified site object, if the DDEX provider supports it. Otherwise, the default instance of type TObject.

Exceptions

Instantiation of a new instance of the support entity threw an exception, whether by way of a CreateInstance call through reflection or through the DDEX provider’s CreateObject(Guid, Type) or CreateObject(Type) method implementation, or creation of the default or client object implementation (if there is one) failed.

Applies to

TryCreateObject<TObject>(Guid)

Tries to create an instance of the specified DDEX support entity for the specified DDEX data source that is implemented by the DDEX provider.

public:
generic <typename TObject>
 TObject TryCreateObject(Guid source);
public TObject TryCreateObject<TObject> (Guid source);
abstract member TryCreateObject : Guid -> 'Object
Public Function TryCreateObject(Of TObject) (source As Guid) As TObject

Type Parameters

TObject

The object.

Parameters

source
Guid

A DDEX data source identifier, or Empty for no specific data source.

Returns

TObject

An instance of the specified DDEX support entity for the specified DDEX data source that is implemented by the DDEX provider, if the DDEX provider supports it. Otherwise, the default instance of type TObject.

Exceptions

Instantiation of a new instance of the support entity threw an exception, whether by way of a CreateInstance call through reflection or through the DDEX provider’s CreateObject(Guid, Type) or CreateObject(Type) method implementation, or creation of the default or client object implementation (if there is one) failed.

Applies to

TryCreateObject<TObject>()

Tries to create an instance of the specified DDEX support entity that is implemented by the DDEX provider.

public:
generic <typename TObject>
 TObject TryCreateObject();
public TObject TryCreateObject<TObject> ();
abstract member TryCreateObject : unit -> 'Object
Public Function TryCreateObject(Of TObject) () As TObject

Type Parameters

TObject

The object.

Returns

TObject

An instance of the specified DDEX support entity that is implemented by the DDEX provider, if the DDEX provider supports it; otherwise, the default instance of type Object.

Exceptions

Instantiation of a new instance of the support entity threw an exception, whether by way of a CreateInstance call through reflection or through the DDEX provider’s CreateObject(Type) method implementation, or creation of the default or client object implementation (if there is one) failed.

Applies to

TryCreateObject<TSite>(Guid, Type, TSite)

Tries to create an instance of the specified DDEX support entity for the specified DDEX data source that is implemented by the DDEX provider, sited with the specified site object.

public:
generic <typename TSite>
 System::Object ^ TryCreateObject(Guid source, Type ^ objType, TSite site);
public object TryCreateObject<TSite> (Guid source, Type objType, TSite site);
abstract member TryCreateObject : Guid * Type * 'Site -> obj
Public Function TryCreateObject(Of TSite) (source As Guid, objType As Type, site As TSite) As Object

Type Parameters

TSite

The site.

Parameters

source
Guid

A DDEX data source identifier, or Empty for no specific data source.

objType
Type

A type of DDEX support entity.

site
TSite

An instance of an object that should site the new DDEX support entity.

Returns

An instance of the specified DDEX support entity that is implemented by the DDEX provider, sited with the specified site object, if the DDEX provider supports it; otherwise, null.

Exceptions

The objType parameter is null.

Instantiation of a new instance of the support entity threw an exception, whether by way of a CreateInstance call through reflection or through the DDEX provider’s CreateObject(Guid, Type) or CreateObject(Type) method implementation, or creation of the default or client object implementation (if there is one) failed.

Applies to