M
Michael C
I'm trying to convert this interface over to C# but can't get any of the
functions to work at all. I'm just trying as a start to get the get_Name
function to work but can't get anything out of it that looks like a BSTR. I
don't have a full understanding of how com works on this level, I'm only
using "InterfaceIsDual" because it seems to work best. I even tried
modifying the get_Name function so that it returned strName as an int and
just looked up the memory address but couldn't see anything in memory that
looked even vaugely like string.
Many thanks in advance. The C++ version is below and my C# version below
that.
DEFINE_GUID(IID_IFilterInfo,0x56A868BAL,0x0AD4,0x11CE,0xB0,0x3A,0x00,0x20,0xAF,0x0B,0xA7,0x70);
DECLARE_INTERFACE_(IFilterInfo, IDispatch)
{
BEGIN_INTERFACE
STDMETHOD(FindPin)(THIS_ BSTR strPinID, IDispatch * FAR* ppUnk) PURE;
STDMETHOD(get_Name)(THIS_ BSTR FAR* strName) PURE;
STDMETHOD(get_VendorInfo)(THIS_ BSTR FAR* strVendorInfo) PURE;
STDMETHOD(get_Filter)(THIS_ IUnknown * FAR* ppUnk) PURE;
STDMETHOD(get_Pins)(THIS_ IDispatch * FAR* ppUnk) PURE;
STDMETHOD(get_IsFileSource)(THIS_ long FAR* pbIsSource) PURE;
STDMETHOD(get_Filename)(THIS_ BSTR FAR* pstrFilename) PURE;
STDMETHOD(put_Filename)(THIS_ BSTR strFilename) PURE;
};
[ComVisible(true), ComImport,
Guid("56A868BA-0AD4-11CE-B03A-0020AF0BA770"),
InterfaceType(ComInterfaceType.InterfaceIsDual)]
internal interface IFilterInfo
{
[PreserveSig]
int get_Name([Out, MarshalAs(UnmanagedType.LPWStr)] out string strName);
}
functions to work at all. I'm just trying as a start to get the get_Name
function to work but can't get anything out of it that looks like a BSTR. I
don't have a full understanding of how com works on this level, I'm only
using "InterfaceIsDual" because it seems to work best. I even tried
modifying the get_Name function so that it returned strName as an int and
just looked up the memory address but couldn't see anything in memory that
looked even vaugely like string.
Many thanks in advance. The C++ version is below and my C# version below
that.
DEFINE_GUID(IID_IFilterInfo,0x56A868BAL,0x0AD4,0x11CE,0xB0,0x3A,0x00,0x20,0xAF,0x0B,0xA7,0x70);
DECLARE_INTERFACE_(IFilterInfo, IDispatch)
{
BEGIN_INTERFACE
STDMETHOD(FindPin)(THIS_ BSTR strPinID, IDispatch * FAR* ppUnk) PURE;
STDMETHOD(get_Name)(THIS_ BSTR FAR* strName) PURE;
STDMETHOD(get_VendorInfo)(THIS_ BSTR FAR* strVendorInfo) PURE;
STDMETHOD(get_Filter)(THIS_ IUnknown * FAR* ppUnk) PURE;
STDMETHOD(get_Pins)(THIS_ IDispatch * FAR* ppUnk) PURE;
STDMETHOD(get_IsFileSource)(THIS_ long FAR* pbIsSource) PURE;
STDMETHOD(get_Filename)(THIS_ BSTR FAR* pstrFilename) PURE;
STDMETHOD(put_Filename)(THIS_ BSTR strFilename) PURE;
};
[ComVisible(true), ComImport,
Guid("56A868BA-0AD4-11CE-B03A-0020AF0BA770"),
InterfaceType(ComInterfaceType.InterfaceIsDual)]
internal interface IFilterInfo
{
[PreserveSig]
int get_Name([Out, MarshalAs(UnmanagedType.LPWStr)] out string strName);
}