[Guid("148BD527-A2AB-11CE-B11F-00AA00530503"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface ITaskScheduler
{
int SetTargetComputer( [MarshalAs(UnmanagedType.LPWStr)] string computer);
int GetTargetComputer( [MarshalAs(UnmanagedType.LPWStr)] out string computer);
int Enum( [MarshalAs(UnmanagedType.IUnknown)] out object enumworkitems);
int Activate( [MarshalAs(UnmanagedType.LPWStr)] string name,
ref Guid riid,
[MarshalAs(UnmanagedType.IUnknown)] out object obj);
int Delete( [MarshalAs(UnmanagedType.LPWStr)] string name);
int NewWorkItem( [MarshalAs(UnmanagedType.LPWStr)] string name,
ref Guid rclsid,
ref Guid riid,
[MarshalAs(UnmanagedType.IUnknown)] out object obj);
int AddWorkItem( [MarshalAs(UnmanagedType.LPWStr)] string name,
[MarshalAs(UnmanagedType.IUnknown)] object obj);
int IsOfType( [MarshalAs(UnmanagedType.LPWStr)] string name,
ref Guid riid);
};
using System;
using System.Runtime.InteropServices;
static public Guid CLSID_ITaskScheduler = new Guid("148BD52A-A2AB-11CE-B11F-00AA00530503");
static public ITaskScheduler CreateTaskScheduler()
{
Type obj = Type.GetTypeFromCLSID(CLSID_ITaskScheduler, true);
return Activator.CreateInstance(obj) as ITaskScheduler;
}
<ComImport> _
<Guid("TODO")> _
'TODO: Insert <InterfaceType(ComInterfaceType.InterfaceIsIUnknown)> _ if this doesn't derive from IDispatch
Interface ITaskScheduler
TODO
End Interface
None.
None.
http://www.codeproject.com/KB/cs/tsnewlib.aspx