I found the solution in some other post ... a little involved but
works.
[Guid("00020400-0000-0000-C000-000000000046")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IDispatch
{
[PreserveSig]
int GetTypeInfoCount(out int Count);
[PreserveSig]
int GetTypeInfo( [MarshalAs(UnmanagedType.U4)] int iTInfo,
[MarshalAs(UnmanagedType.U4)] int lcid, out UCOMITypeInfo
typeInfo);
[PreserveSig]
int GetIDsOfNames( ref Guid riid,
[MarshalAs(UnmanagedType.LPArray,
ArraySubType=UnmanagedType.LPWStr)]
string[] rgsNames,
int cNames, int lcid,
[MarshalAs(UnmanagedType.LPArray)] int[]
rgDispId);
[PreserveSig]
int Invoke(int dispIdMember, ref Guid riid, uint lcid, ushort
wFlags,
ref DISPPARAMS pDispParams, out object pVarResult, ref
EXCEPINFO
pExcepInfo, IntPtr[] pArgErr);
}
if (component.GetType().IsCOMObject)
{
IDispatch cd = (IDispatch) component;
int cnt;
cd.GetTypeInfoCount(out cnt);
if (cnt == 1)
{
UCOMITypeInfo ti;
cd.GetTypeInfo(0, 0, out ti);
IntPtr pti;
ti.GetTypeAttr(out pti);
TYPEATTR ta = (TYPEATTR)
Marshal.PtrToStructure(pti, typeof(TYPEATTR));
int funcs = ta.cFuncs;
ti.ReleaseTypeAttr(pti);
for (int i = 0; i < funcs; i++)
{
IntPtr pfd;
ti.GetFuncDesc(i, out pfd);
FUNCDESC fd = (FUNCDESC)
Marshal.PtrToStructure(pfd, typeof(FUNCDESC));
string[] names = { "" };
int ret;
ti.GetNames(fd.memid, names, names.Length,
out ret);
string name = names[0];
ti.ReleaseFuncDesc(pfd);
}
}
}