VariantWrapper(Object) Oluşturucu
Tanım
Önemli
Bazı bilgiler ürünün ön sürümüyle ilgilidir ve sürüm öncesinde önemli değişiklikler yapılmış olabilir. Burada verilen bilgilerle ilgili olarak Microsoft açık veya zımni hiçbir garanti vermez.
Belirtilen Object parametre için sınıfının yeni bir örneğini VariantWrapper başlatır.
public:
VariantWrapper(System::Object ^ obj);
public VariantWrapper (object obj);
public VariantWrapper (object? obj);
new System.Runtime.InteropServices.VariantWrapper : obj -> System.Runtime.InteropServices.VariantWrapper
Public Sub New (obj As Object)
Parametreler
- obj
- Object
Sıralı nesne.
Örnekler
Aşağıdaki kod örneği, birlikte çalışma sıralayıcısının VariantWrapper olarak VT_VARIANT | VT_BYREF
geçirdiği bir Object sarmalama için sınıfının nasıl kullanılacağını gösterir.
// Create an instance of an unmanged COM object.
UnmanagedComClass UnmanagedComClassInstance = new UnmanagedComClass();
// Create a string to pass to the COM object.
string helloString = "Hello World!";
// Wrap the string with the VariantWrapper class.
object var = new System.Runtime.InteropServices.VariantWrapper(helloString);
// Pass the wrapped object.
UnmanagedComClassInstance.MethodWithStringRefParam(ref var);
' Create an instance of an unmanged COM object.
Dim UnmanagedComClassInstance As New UnmanagedComClass()
' Create a string to pass to the COM object.
Dim helloString As String = "Hello World!"
' Wrap the string with the VariantWrapper class.
Dim var As Object = New System.Runtime.InteropServices.VariantWrapper(helloString)
' Pass the wrapped object.
UnmanagedComClassInstance.MethodWithStringRefParam(var)
Şunlara uygulanır
GitHub'da bizimle işbirliği yapın
Bu içeriğin kaynağı GitHub'da bulunabilir; burada ayrıca sorunları ve çekme isteklerini oluşturup gözden geçirebilirsiniz. Daha fazla bilgi için katkıda bulunan kılavuzumuzu inceleyin.