调用API的时候,如果一个结构体要设置为NULL,那在C#中应该如何实现啊?例如:
HANDLE CreateEvent(
LPSECURITY_ATTRIBUTES lpEventAttributes,
BOOL bManualReset,
BOOL bInitialState,
LPTSTR lpName
); lpEventAttributes
[in] Ignored. Must be NULL.
这个C#中应该如何设置啊?谢谢
HANDLE CreateEvent(
LPSECURITY_ATTRIBUTES lpEventAttributes,
BOOL bManualReset,
BOOL bInitialState,
LPTSTR lpName
); lpEventAttributes
[in] Ignored. Must be NULL.
这个C#中应该如何设置啊?谢谢
[DllImport("Kernel32.dll", CharSet = CharSet.Auto)]
public static extern IntPtr CreateEvent(
IntPtr lpEventAttributes,
bool bManualReset,
bool bInitialState,
string lpName);
你在调用这个函数的时候可以这样:
CreateEvent(IntPtr.Zero, false, true, “TRY”)