A
adx
I want to use an interface of a COM object (implemented in C++) using
Interop.
1. Should it be simply just implement an interface on C# side with syntax
like below?
[ComImport]
[Guid("xxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
interface ITestInterface
{
[PreserveSig]
int GetTestLevel(out int level);
2. Do all methods in the original interface have to be implemented on C#
side?
3. Should "xxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx" be the interface GUID or CoClass
ID of the COM object?
4. What do "[ComImport]" and "[PreserveSig]" mean?
Interop.
1. Should it be simply just implement an interface on C# side with syntax
like below?
[ComImport]
[Guid("xxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
interface ITestInterface
{
[PreserveSig]
int GetTestLevel(out int level);
2. Do all methods in the original interface have to be implemented on C#
side?
3. Should "xxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx" be the interface GUID or CoClass
ID of the COM object?
4. What do "[ComImport]" and "[PreserveSig]" mean?