问题标签 [dll]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
8 回答
45962 浏览

c# - 如何将 C++ windows dll 合并到 C# 应用程序 exe 中?

我有一个使用 C++ dll 进行数据 i/o 的 Windows C# 程序。我的目标是将应用程序部署为单个 EXE。

创建这样的可执行文件的步骤是什么?

0 投票
6 回答
46732 浏览

c++ - DLL 中声明的全局变量会怎样?

假设我用 C++ 编写了一个 DLL,并声明了一个具有非平凡析构函数的类的全局对象。DLL卸载时会调用析构函数吗?

0 投票
5 回答
3734 浏览

ruby - 在 Windows 上检查 Ruby 中的文件版本

Ruby 中有没有办法找到文件的版本,特别是 .dll 文件?

0 投票
5 回答
930 浏览

c++ - 将 EXE 数据传递给一个或多个 DLL

我们当前的应用程序是一个包含多个页面的单个 OpenGL EXE。EXE 负责访问通过 UDP 通过网络发送的数据。它累积数据并将其存储在许多单例结构中。EXE 中的各个页面访问单例结构以按照它们认为合适的方式处理数据。

为了减轻我们的 EXE 占用空间并支持我们在配置管理方面的尝试,我们决定将页面拆分为一个单独的 DLL,EXE 将加载该 DLL。我们的目的是让 EXE 成为加载 DLL 页面的 shell。EXE 仍将承担所有通信职责(UDP、Corba、用户等)。这些页面仍将负责显示它们所做的任何事情。

问题(最终)变成了:如何将这些从 EXE 收集的无数数据传递到基于 DLL 的消费页面。单例概念不再成立,因为我们使用的单例 (ACE_Singleton) 不允许这种级别的方向。我们可以整天将单例从 DLL 导出到消耗的 EXE,但我还没有弄清楚相反的情况。我想出了以下选项-我都不喜欢,所以我希望那里的人会有更好的选择:)

  1. 将当前存储在单独单例中的所有数据包装到另一个 DLL 中,该 DLL 将导出“真正的”单例。例如。从 DLL 导出的单例将是相同的 - 无论 EXE 加载了什么 - 有点像共享内存。这是一个有趣的选择,但会导致我们的部署方案出现问题。如果人们真的被这个想法迷住了,我可以详细讨论这些问题。
  2. 创建一个包含所有相关数据的静态 DLL 级结构。EXE 会在 DLL 加载时将此数据下推到 DLL,以便 DLL 中包含的页面可以访问数据。这似乎是最简单的解决方案——即使它需要编辑我们应用程序中的每一页——超过 100 个。它也似乎有点草率。所有数据都在一个全局范围内。也不是很性感或 C++y。

那么,还有其他人有解决这个问题的方法吗?

该应用程序使用 Visual C++ 9.0 (VisualStudio 2008) 编写,可在 Windows XP 上使用。出于某种原因,我们的实验室还不支持 Vista——即使我们的客户正在使用它。

0 投票
4 回答
1092 浏览

excel - 如何在 VBA 中为 Excel 或 Access 项目使用 VisualBasic-Express 中的类?

我将我的 VB-Express 代码保存为 .dll 并使用 regasm 注册它并制作了一个 .tlb 文件。

但是当我尝试在 Excel 模块中运行它的函数时,我得到:运行时错误“453”:在 kernel32 中找不到 DLL 入口点 RegisterServiceProcess

我错过了哪一步?

0 投票
1 回答
313 浏览

winapi - How to protect yourself against shell DLLs loaded into your process?

When you use a standard Windows "file open" dialog using GetOpenFileName(), the shell will load various DLLs that it requires to display the file list, including custom ones.

In my application, I found that the DLL that TortoiseCVS uses to draw overlays on the icons was calling GdiPlusShutdown(), and so some time after displaying a "file open" dialog, the TortoiseCVS DLL would be unloaded, it would shut down GDI+ and my graphics functions would all fail!

It seems quite bad that basically any old DLL could be loaded by my application at any time and start doing random things to its state. The workaround in my case was quite simple - just restart GDI+ if I detect that it's been shut down. However had this happened on a client's machine where I couldn't debug it, it would have been a lot more challenging to figure out what was going on.

Can anybody offer any insight? What could I do to stop this from happening?

0 投票
6 回答
49640 浏览

c# - 将一个 dll 作为嵌入式资源嵌入到另一个 dll 中,然后从我的代码中调用它

我有一种情况,我正在创建一个使用另一个第三方 DLL 的 DLL,但我希望能够将第三方 DLL 构建到我的 DLL 中,而不是尽可能将它们保存在一起。

这是 C# 和 .NET 3.5。

我想这样做的方法是将第三方 DLL 存储为嵌入式资源,然后在执行第一个 DLL 期间将其放置在适当的位置。

我最初计划这样做的方法是编写代码将第三方 DLL 放在System.Reflection.Assembly.GetExecutingAssembly().Location.ToString() 减去 last指定的位置/nameOfMyAssembly.dll。我可以在此位置成功保存第三方.DLL(最终成为

C:\Documents and Settings\myUserName\Local Settings\Application Data\assembly\dl3\KXPPAX6Y.ZCY\A1MZ1499.1TR\e0115d44\91bb86eb_fe18c901

),但是当我到达需要此 DLL 的代码部分时,它找不到它。

有人知道我需要做些什么不同的事情吗?

0 投票
7 回答
14200 浏览

c++ - Best resources for converting C/C++ dll headers to Delphi?

A rather comprehensive site explaining the difficulties and solutions involved in using a dll written in c/c++ and the conversion of the .h header file to delphi/pascal was posted to a mailing list I was on recently, so I thought I'd share it, and invite others to post other useful resources for this, whether they be links, conversion tools, or book/paper titles.

One resource per answer please, so we'll end up with the most popular/best resources bubbling to the top.

0 投票
3 回答
11101 浏览

c++ - 使用许可文件保护 DLL 文件

使用许可证文件保护 DLL 的使用/加载的最佳方法是什么?

0 投票
3 回答
13588 浏览

windows - 是否有与 -rpath 链接器标志等效的 Windows/MSVC?

在 Linux/GCC 上,我可以使用 -rpath 标志来更改共享库的可执行文件搜索路径,而无需调整环境变量。

这也可以在 Windows 上完成吗?据我所知,总是在可执行文件的目录和 PATH 中搜索 dll。

我的场景:我想根据共享库的属性(32/64 位/调试/发布)将共享库放入位置,而不考虑唯一名称。在 Linux 上,这很容易通过 rpath 完成,但我还没有找到在 Windows 上执行此操作的任何方法。

感谢您的任何提示!