将DLL导入Inno-Setup时出现问题 [英] Problem with importing DLL into Inno-Setup

查看:1303
本文介绍了将DLL导入Inno-Setup时出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在innosetup安装脚本中导入C ++ DLL。 DLL代码如下:

I am importing an C++ DLL in an innosetup install script. The DLL code is as follows:

void __stdcall SetFbParam(char *dbFileName,char *dbTableName,char *dbParamName,char *dbParamValue){
//of no use here and doesn't change anything}

Innosetup,我使用

In the Innosetup, I import it using

procedure FBset(dbFileName,dbTableName,dbParamName,dbParamValue: String;);

external'SetFbParam @ files:MyDll.dll stdcall setuponly' code>

external 'SetFbParam@files:MyDll.dll stdcall setuponly';

但是,我总是在启动安装程序时遇到运行时错误,说它不能导入我的dll。我尝试了各种调用约定,但它总是失败。
如果它是任何重要性,我正在运行Win7 x64与UAC(安装程序请求的权利海拔和崩溃后)。

However, I always get a runtime error during launch of the installer, saying that it cannot import my dll. I tried it with various calling conventions, but it always fails. If it's of any importance, I'm running Win7 x64 with UAC on ( the installer requests rights elevation and crashes after that).

确切的消息是:

错误

运行时错误(在-1:0时):

无法导入

dll:C:\Users\\ \\ Nevod \AppData\Local\Temp\is-6LOEC.tmp\MyDll.dll

The exact message is:
Error
Runtime error (at -1:0):
Cannot import
dll:C:\Users\Nevod\AppData\Local\Temp\is-6LOEC.tmp\MyDll.dll

dll在这里。

谢谢!

推荐答案

MyDll.dll 32位?

Is MyDll.dll 32-bit?

MyDll.dll是否依赖于同一目录中的任何其他DLL?如果是这样,你需要在MyDll.dll之后列出这些DLL的名称,以确保它们在 MyDll.dll加载之前被提取,并且你可能需要loadwithalteredsearchpath选项以及。 帮助中的示例:

Does MyDll.dll depend on any other DLLs in the same directory? If so, you need to list the name(s) of those DLLs after "MyDll.dll" to ensure that they are extracted before MyDll.dll is loaded, and you likely need the "loadwithalteredsearchpath" option as well. Example from the help:

procedure ADllFunc(hWnd: Integer; lpText, lpCaption: String; uType: Cardinal);
external 'ADllFunc@files:A.dll,B.dll stdcall loadwithalteredsearchpath'; //A.dll depends on B.dll

这篇关于将DLL导入Inno-Setup时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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