M
Merlynx
i am getting that error with the Event() method.
Don't know whether if i have used the CreateEvent function well as it is the
1st time i used it moreover i am net to C#.
If anyone can point me out the error it would be great.
TIA
public class Class
{
public struct SECURITY_ATTRIBUTES{
public long nLength;
public long IpSecurityDescriptor;
public long bInheritHandle;
public SECURITY_ATTRIBUTES(long nLength,long
IpSecurityDescriptor,long bInheritHandle){
this.nLength = nLength;
this.bInheritHandle = bInheritHandle;
this.IpSecurityDescriptor =
IpSecurityDescriptor;
}
}
[DllImport("kernel32")]
public static extern long CreateEvent
(SECURITY_ATTRIBUTES lpEventAttributes,bool bManualReset,bool
bInitialState,string lpName);
public void Event(){
SECURITY_ATTRIBUTES Sd = new SECURITY_ATTRIBUTES();
Sd.nLength = Marshal.SizeOf(Sd);
Sd.bInheritHandle = 0;
Sd.IpSecurityDescriptor = 0;
long Test = CreateEvent(Sd,true,false,"Test");
}
}
Don't know whether if i have used the CreateEvent function well as it is the
1st time i used it moreover i am net to C#.
If anyone can point me out the error it would be great.
TIA
public class Class
{
public struct SECURITY_ATTRIBUTES{
public long nLength;
public long IpSecurityDescriptor;
public long bInheritHandle;
public SECURITY_ATTRIBUTES(long nLength,long
IpSecurityDescriptor,long bInheritHandle){
this.nLength = nLength;
this.bInheritHandle = bInheritHandle;
this.IpSecurityDescriptor =
IpSecurityDescriptor;
}
}
[DllImport("kernel32")]
public static extern long CreateEvent
(SECURITY_ATTRIBUTES lpEventAttributes,bool bManualReset,bool
bInitialState,string lpName);
public void Event(){
SECURITY_ATTRIBUTES Sd = new SECURITY_ATTRIBUTES();
Sd.nLength = Marshal.SizeOf(Sd);
Sd.bInheritHandle = 0;
Sd.IpSecurityDescriptor = 0;
long Test = CreateEvent(Sd,true,false,"Test");
}
}