我通过为我的dll编写一个activex/COM包装器来解决这个问题,我认为这将使以后更容易链接.在沼泽上开始一个线程从好人那里得到了一些关于如何从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
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
2154 次 |
最近记录: |