dll的接口
我听到人们谈论更改 dll 的接口。 dll 的接口有何变化?您将如何做到这一点?
I heard people talking about changing the interface of a dll.
What is a change in the interface of the dll, and how would you do that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
更改 dll 的接口意味着更改 dll 和调用代码的交互方式。这可能意味着更改 dll 导出函数的签名,或者完全更改为一组不同的函数,或者可能意味着从调用代码传递不同的数据。 DLL 的接口通常是其导出和导入的所有项(函数和数据),或者换句话说,是您在使用 DLL 时可以访问的部分。
通常您会希望更改 dll 的行为而不更改其接口。这是因为经常更改接口会破坏使用它的代码。
想象一下我的 dll 导出函数
foo
:更改接口可能意味着将
foo
的签名更改为现在,之前使用 foo 的所有代码都必须重写以使用新签名,这可能是一件坏事。
Changing a dll's interface would mean to change how the dll and the calling code interacts. This could mean changing the signatures of the dll's exporting functions, or changing to a different set of functions entirely, or it could mean passing different data from the calling code. A dll's interface is generally all it's exported and imported items (both functions and data), or in other words, the parts of the dll that you have access to when you use it.
Often you will want to change the behaviour of your dll without changing its interface. This is because changing the interface often will break code that uses it.
Imagine my dll exporting function
foo
:Changing the interface could mean changing
foo
's signature intoNow, all the code that used foo previously has to be rewritten to use the new signature, which could be a bad thing.