F
fabio.trivisonno
cf 1.1
I'm facing with killing a process by its name.
I converted some code found on the net from c# to vb and it works very
well except for some pid values. It gives me Overflow exception
'----
Private m_ihandle As IntPtr
Public th32ProcessID As System.UInt32
Public ReadOnly Property PID() As System.UInt64
Get
Return Convert.ToUInt64(th32ProcessID)
End Get
End Property
'...
m_ihandle = New IntPtr(Convert.ToInt64(peCurrent.PID)) ' <--
System.OverflowException - OverflowException
'----
It's funny because
Convert.ToInt32(peCurrent.PID)
gives me a "System.OverflowException - OverflowException"
so I changed it with
Convert.ToInt64(peCurrent.PID)
it retrieve 2799898626 - Long
The matter seems to be with Intptr constructor but, according to MSDN,
It must accept long argument. Has anyone an idea about it?
Thanks
Fabio
I'm facing with killing a process by its name.
I converted some code found on the net from c# to vb and it works very
well except for some pid values. It gives me Overflow exception
'----
Private m_ihandle As IntPtr
Public th32ProcessID As System.UInt32
Public ReadOnly Property PID() As System.UInt64
Get
Return Convert.ToUInt64(th32ProcessID)
End Get
End Property
'...
m_ihandle = New IntPtr(Convert.ToInt64(peCurrent.PID)) ' <--
System.OverflowException - OverflowException
'----
It's funny because
Convert.ToInt32(peCurrent.PID)
gives me a "System.OverflowException - OverflowException"
so I changed it with
Convert.ToInt64(peCurrent.PID)
it retrieve 2799898626 - Long
The matter seems to be with Intptr constructor but, according to MSDN,
It must accept long argument. Has anyone an idea about it?
Thanks
Fabio