调用 - 的P / Invoke [英] invoke - p/invoke

查看:159
本文介绍了调用 - 的P / Invoke的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是的BeginInvoke / EndInvoke会和P / Invoke的?

what is the difference between BeginInvoke/EndInvoke and P/invoke?

推荐答案

他们只有在共同的动词援引。一般地,调用==电话。在PInvoke的的P意思是平台的PInvoke的编组是code一大块,它知道如何正确地调用原生CLR内(特定平台)code。

They only have the verb "invoke" in common. Generically, invoke == call. The p in pinvoke means "platform", the pinvoke marshaller is a chunk of code inside the CLR that knows how to properly call native (platform specific) code.

BeginInvoke的是启动一个异步方法调用大量重载方法名。编译器会自动生成每一个委托类型。随着调用和EndInvoke。他们是自动生成的,以便它们的参数匹配的委托声明。一个BeginInvoke方法也被WinForms和WPF,分别控制和调度类。完全不同的动物从委托的BeginInvoke的()方法,虽然它开始异步的东西。

BeginInvoke is a heavily overloaded method name that starts an asynchronous method call. The compiler automatically generates one for every delegate type. Along with Invoke and EndInvoke. They are auto-generated so their arguments match the delegate declaration. A BeginInvoke method is also used by Winforms and WPF, respectively the Control and Dispatcher classes. Quite a different animal from a delegate's BeginInvoke() method, although it does start something asynchronously.

这篇关于调用 - 的P / Invoke的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆