Is there a better way to make a dll accessible for use on the system than modifying %PATH%?

技术标签: 视窗  DLL.

I want to make a dll with an exposed C function accessible to applications on the system. Is there a better way to make it available than modifying %PATH%?

Because people don't like adding it to %PATH% 这里.

看答案

You have three options if you want to allow implicit linking to the dll :-

  • Create a native Win32 assembly that contains the dll and install it to WinSxS. This requires creating a simple .manifest file, the use of some crypto tools to sign the assembly (being the manifest file and the dll), and creating an MSI installer - or call IAssemblyCache directly to perform the actual install.

  • Install the dll to System32 - with this option you need to ensure the dll has a relativly unique name.

  • Ad the path to the dll to the someplace on the PATH (or modify path to point to the dll).

Other options if implicit linking to the C Function isn't critical:-

  • Create an COM interface that exposes the c-method. Register the path to the dll in the registry and users of the dll use CoCreateInstance to get the interface containing the function.

  • Store the path to the dll in the registry, and expect users of the dll to use that path with LoadLibrary, and GetProcAddress to load the dll.


智能推荐

A run cannot be made because there is no vehicle solver DLL file in the simfile解决办法(二)

MATLAB与Carsim联合仿真时,出现下面错误: 1、Matlab/Carsim solver DLL not found, invalid port dimensions 2、A run cannot be made because there is no vehicle solver DLL file in the simfile. If you do have a solver DLL ...

OSError: Unable to download ‘freeimage-3.15.1-win64.dll‘. Perhaps there is a no internet connection?

@[](OSError: Unable to download ‘freeimage-3.15.1-win64.dll’. Perhaps there is a no internet connection? If there is, please report this problem.) 问题描述 在运行可微渲染器redner中的一个测试用例test_two_trian...

《A Mixture of h-1 Heads is Better than h Heads》论文笔记

1、摘要   多头注意神经结构已经在各种自然语言处理任务上取得了最先进的结果。 事实证明,它们是过度参数化的,注意力头可以被修剪而不会造成显著的性能损失。 论文提出:根据输入的不同,选择不同的header,提出了专注其中几个header的专家混合模型(MAE)。 MAE使用block coordinate descent (BCD:块协同下降算法)进行训练,该算法交替更新(1)...

How to make a Dialogue System in Unity

来源:Brackeys   Brackeys的Dialogue System教程学习笔记。 ------------------------------------------------------------------ 1.UI    2.创建Dialogue Manager 新建C#命名为Dialogue用来设定数据格式,打开并编辑。 新建C#命名为...

解决Genymotion模拟器无法使用问题“the file is currupt”,“uable to boot-please use a kernel appropriate for your c

1.安装了Genymotion和VirtualBox后,在Genymotion中点击add,添加一个模拟器   2.点击确定后,提示“the file is currupt”,下载模拟器失败   解决方法: 1)到D:\Users\yourname\AppData\Local\Genymobile\Genymotion\ova该目录下找ova文件,you...

猜你喜欢

redis中的hash扩容渐进式rehash过程

背景: redis字典(hash表)当数据越来越多的时候,就会发生扩容,也就是rehash 对比:java中的hashmap,当数据数量达到阈值的时候(0.75),就会发生rehash,hash表长度变为原来的二倍,将原hash表数据全部重新计算hash地址,重新分配位置,达到rehash目的 redis中的hash表采用的是渐进式hash的方式: 1、redis字典(hash表)底层有...

不同系统下的回车\r和换行\n,及其历史

2019独角兽企业重金招聘Python工程师标准>>>      我们平时按下键盘上的‘回车键’,就能实现回车换行【我们在屏幕上所看到的就是光标移到了下一行的开头位置!!ps:不讨论软件实现的特殊功能,如word里的回车智能缩进】。因此对这个按键更准确说应该叫做‘回车换行键’ 就且将这种将光标移到下行开...

windows操作系统,python环境下django的自动安装

首先,在Windows操作系统下安装python,完成python环境的搭建。(我看有的博客需要配置环境变量,其实不必要,因为我们在安装的时候只要勾选如下图所示即可避免不必要的麻烦) 第二步,使用快捷键windows+R或者点击如下图所示,之后点击运行 在其中输入cmd即可进入dos命令。 第三步,输入以下命令 就会自动安装,等待安装完成即可。 第四步,检测django是否安装成功,如果出现如下图...

Qt之日志输出文件

    做过项目的童鞋可能都使用过日志功能,以便有异常错误能够快速跟踪、定位,Qt也提供的类似的机制。之前用Qt4做项目时使用的是Qt::qInstallMsgHandler(),到了Qt5,使用了新的Qt::qInstallMessageHandler()来替代,详情请查看Qt助手(C++ API changes)。 描述     助手中在C++ API ...

基于雇员流失率数据进行多分类模型训练及阈值调整实践-大数据ML样本集案例实战

版权声明:本套技术专栏是作者(秦凯新)平时工作的总结和升华,通过从真实商业环境抽取案例进行总结和分享,并给出商业应用的调优建议和集群环境容量规划等内容,请持续关注本套博客。QQ邮箱地址:[email protected],如有任何学术交流,可随时联系。 1 数据的预处理分析 2 数据标准化处理 3 sklearn多模型封装(已废弃,学思想) 4 阈值概率调整 5 总结 方便复习,整成笔记,内容粗略...

问答精选

How to get the sum of rows using a vector and the make the result in a column

I have a dataframe and i want to calculate the sum of variables present in a vector in every row and make the sum in other variable after i want the name of new variable created to be from the name of...

Call a custom class in zend framework

I have a very rough project that done partially in zend framework (not ZF2). The 'application', 'library' and 'public' folders are on the same root. Now i need to create a library 'Anil' in the 'libra...

Hide Some Of The Categories In Magento?

I want to hide some of the categories from magento home page. I have created some categories like New Arrivals, Special Offer Which I would like to show in some different way may be in left panel or r...

Reading an internal file in Android Studio

I am writing to an internal file in Android Studio The code lets me write lines of data split with commas. I am able to then go to another activity and read it all out at once. However I want to be ab...

Rails Acts_as_votable Gem Like/Unlike Buttons with Ajax

I'm new to Ruby On Rails, I used the acts_as_votable gem to create Like and Unlike Buttons to make Users like and unlike Posts but I can't make them change from Like to Unlike (and viceversa) and upda...

相关问题

相关文章

热门文章

推荐文章

相关标签

推荐问答