最初在这里发布(https://stackoverflow.com/questions/32617735/declared-dll-but-errors-external-function-not-found),但被告知不要使用类和名称空间。重新发布一个简单的例子,我仍然无法工作。声明的Hello World DLL文件。在运行时没有找到外部函数
DLL用C++(Visual Studio中)制成:
// myFirstDLL.h
#define DECLDIR __declspec(dllexport)
DECLDIR int GIMMEFIVE();
// myFirstDLL.cpp
#include "stdafx.h"
#include "myFirstDLL.h"
#include <stdexcept>
//using namespace std;
int GIMMEFIVE()
{
return 5;
}
LotusScript代理:
Option Public
Option Declare
Declare Public Function GIMMEFIVE Lib "P:\Internet\dplows\visualstudio\myFirstDLL\myFirstDLL\Debug\myFirstDLL.dll"() As Integer
Sub Initialize
MsgBox GIMMEFIVE()
End Sub
莲花脚本预计什么调用约定? – Niall
@Niall,它非常类似于VB。只是FYI,我已经成功地从DLL中调用函数(通过user32.dll在任务栏中刷新当前窗口)。一定是我的错。 – dplows
[This may help](http://www-01.ibm.com/support/knowledgecenter/#!/SSVRGU_9.0.1/com.ibm.designer.domino.main.doc/LSAZ_WORKING_WITH_EXTERNAL_C_LANGUAGE_FUNCTIONS.html)。您可能还想使用Dependency Walker查看导出函数的名称。我不知道louts脚本,但VBA可能会对函数名称感到烦恼(https://msdn.microsoft.com/en-us/library/aa235591(v=vs.60).aspx) – Niall