Please help with syntax importing an API into .NET, below is the signature. I am having trouble with specifying and passing parameters. Thanks
NetScheduleJobAdd
LPCWSTR Servername,
LPBYTE Buffer,
LPDWORD JobId
)
Sean,
I'd try it like this
[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)]
struct AT_INFO
{
public IntPtr JobTime;
public uint DaysOfMonth;
public byte DaysOfWeek;
public byte Flags;
public string Command;
}
[DllImport("netapi32.dll", CharSet=CharSet.Unicode)]
static extern NetScheduleJobAdd(string Servername, ref AT_INFO Buffer,
out uint JobId);
Mattias

Signature
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Sean Z - 22 Apr 2004 00:51 GMT
Perfect - worked. Thanks a lot Mattias.