c++ - 视觉口齿不清 : how to call functions in external C++ DLL

标签 c++ dll autocad autolisp

我有一个我编写的 C++ dll( native ,而不是 .net),我想使用 Visual Lisp 的功能。任何人都可以指出如何执行此操作的示例,或者至少要阅读哪部分文档吗?

最佳答案

我通过为我的 dll 编写一个 activex/COM 包装器解决了这个问题,我认为这应该使将来更容易链接。在 the swamp 上开始一个线程从好人那里得到了一些关于如何从 Visual Lisp 调用 COM 的答案。作为记录,它看起来像这样:

//in c++... (header and IDL file also needed)
hresult timestwo(double in,double* out)
{
  *out = in*2;
  return S_OK;
}

;; in Lisp...
(vl-load-com)
(setq myinstance (vlax-create-object "mycomwrapperdll.mycomwrapperclass"))
(setq num 12.34)
(vlax-invoke-method myinstance 'timestwo num 'newnum)
(vlax-release-object myinstance)
;; newnum now contains 24.68

关于c++ - 视觉口齿不清 : how to call functions in external C++ DLL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8477753/

相关文章:

c++ - DLL 如何解析它的 IAT?

c# - 在 C# 中查找 AutoCAD 属性的单位

powershell - 这些函数定义不一样吗?

c++ - 使用宏定义打印格式参数

c++ - OpenGL Compute Shader 渲染到 3D 纹理似乎没有做任何事情

java - JNA通过java找不到dll文件中指定的程序

c++ - lib 文件有效,但 dll 文件无效

wolfram-mathematica - 在 Mathematica 中沿 3D 路径移动 AutoCad DXF 实体

c++ - 如何在 Ubuntu 上安装 OpenSSL 库?

c++ - 如何测试引用是否为 NULL?