gpt4 book ai didi

c++ - 在混合模式 DLL 中链接到 presentationcore.dll

转载 作者:塔克拉玛干 更新时间:2023-11-03 08:00:22 27 4
gpt4 key购买 nike

我们有一个用 C++ 编写的混合模式 DLL,它包装了 native C++ DLL 并公开了托管类。在公开的托管类中,我们使用 Vector3D 等类型的方法参数,它们是 PresentationCore.DLL 的一部分。

因此,混合模式C++代码需要引用PresentationCore.DLL。我们通过

#using <PresentationCore.dll>

这需要项目的搜索路径包含 PresentationCore.dll 所在的文件夹。

这很糟糕,因为这些文件夹在不同的机器上是不同的,我们的项目需要在多台机器上不做任何更改地进行编译。目前,我们通过在我们的代码存储库中包含一个 PresentationCore.dll 的拷贝来解决这个问题,这显然不是一个好的解决方案。

如果您能提出建议,我将不胜感激,因为我们可以避免指定一个应该可以通过 GAC 完美访问的 DLL 的显式路径。

最佳答案

不要做#using <PresentationCore.dll> .您需要右键单击该项目,转到 References... , 点击 Add New Reference...然后选择 PresentationCore来自 .Net标签。我从以下位置得到提示:

http://msdn.microsoft.com/en-us/library/aa970266.aspx

关于c++ - 在混合模式 DLL 中链接到 presentationcore.dll,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8891688/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com