endofcsharp
June 21st, 2006, 05:59 PM
Hi everybody
I want to write some code with C# using Threading functionality
I want to use Windows API's for that (not System.Threading namespace)
to use that, I have to use these API :
[DllImport("kernel32.dll", SetLastError=true)] static extern int CreateThread (ref SECURITY_ATTRIBUTES lpThreadAttributes,
int dwStackSize, ref int lpStartAddress,
ref object lpParameter, int dwCreationFlags,
ref int lpThreadId)
As you can see, I need to set the parameter lpStartAddress that points to the Method that the thread must execute it
How can I get the method address ?
in VB.net therese an operator called AddressOf that returns the address of method ?
Is there anything like that in C#?
I want to write some code with C# using Threading functionality
I want to use Windows API's for that (not System.Threading namespace)
to use that, I have to use these API :
[DllImport("kernel32.dll", SetLastError=true)] static extern int CreateThread (ref SECURITY_ATTRIBUTES lpThreadAttributes,
int dwStackSize, ref int lpStartAddress,
ref object lpParameter, int dwCreationFlags,
ref int lpThreadId)
As you can see, I need to set the parameter lpStartAddress that points to the Method that the thread must execute it
How can I get the method address ?
in VB.net therese an operator called AddressOf that returns the address of method ?
Is there anything like that in C#?