I want to ask why all extern method calls are static? How the CLR handles these calls?
Extern method calls are to unmanaged code. As such, it doesn't make sense to be called on a (managed) object instance - the first (hidden) argument in an instance method is the instance reference, aka this
. Typically, extern
methods just involve simple types (primitives, string, etc) - not objects (except perhaps arrays - and even they are often resolved to IntPtr
first).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With