Re: Convert C# 'ComImport' to VB



Basically, my problem is that the ComImport attribute cannot be used in VB
(as documented in KB313506:
http://support.microsoft.com/kb/313506/en-us?spid=7796&sid=global).

That's only true for classes, the article doesn't apply for
interfaces.


/// But I cannot figure out how to convert parts of this where I say
"<--this bit":
[ComImport] <--this bit
[Guid("89BCB740-6119-101A-BCB7-00DD010655AF")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IFilter
{
void Init([MarshalAs(UnmanagedType.U4)]
IFILTER_INIT grfFlags, <--this bit
uint cAttributes,
[MarshalAs(UnmanagedType.LPArray, SizeParamIndex=1)]
FULLPROPSPEC[] aAttributes, <--this bit
ref uint pdwFlags);

[PreserveSig]
int GetChunk(out STAT_CHUNK pStat); <--this bit

[PreserveSig]
int GetText(ref uint pcwcBuffer,
[MarshalAs(UnmanagedType.LPWStr)]
StringBuilder buffer
);

void GetValue(ref UIntPtr ppPropValue);

void BindRegion([MarshalAs(UnmanagedType.Struct)]
FILTERREGION origPos, <--this bit
ref Guid riid,
ref UIntPtr ppunk);
}

.... , ByVal grfFlags As IFILTER_INIT, ...

.... (<Out> ByRef pStat As STAT_CHUNK)

Sub BindRegion(ByVal origPos As FILTERREGION, ...


Mattias

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
.



Relevant Pages