找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 442|回复: 1

[求助] [求助]:如何在VLISP调其它dll中的函数???

[复制链接]
发表于 2004-12-30 18:59:48 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
如何在VLISP调其它dll中的函数???
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
发表于 2004-12-30 19:08:25 | 显示全部楼层
Imports information from a type library

(vlax-import-type-library :tlb-filename filename [:methods-prefix mprefix :properties-prefix pprefix :constants-prefix cprefix])

Arguments

filename

A string naming the type library. A file can be one of the following types:

A type library (TLB) or object library (OLB) file
An executable (EXE) file
A library (DLL) file containing a type library resource
A compound document holding a type library
Any other file format that can be understood by the LoadTypeLib API
If you omit the path from tlb-filename, AutoCAD looks for the file in the Support File Search Path.

mprefix

Prefix to be used for method wrapper functions. For example, if the type library contains a Calculate method and the mprefix parameter is set to "cc-", Visual LISP generates a wrapper function named cc-Calculate. This parameter defaults to "".

pprefix

Prefix to be used for property wrapper functions. For example, if the type library contains a Width property with both read and write permissions, and pprefix is set to "cc-", then Visual LISP generates wrapper functions named cc-get-Width and cc-put-Width. This parameter defaults to "".

cprefix

Prefix to be used for constants contained in the type library. For example, if the type library contains a ccMaxCountOfRecords property with both read and write permissions, and cprefix is set to "cc-", Visual LISP generates a constant named cc-ccMaxCountOfRecords. This parameter defaults to "".

Note the required use of keywords when passing arguments to vlax-import-type-library.

Return Values

T, if successful.

Examples

Import a Microsoft Word type library, assigning the prefix "msw-" to methods and properties, and "mswc-" to constants:

_$ (vlax-import-type-library
   :tlb-filename "c:/program files/microsoft office/msword8.olb"
   :methods-prefix "msw-"
   :properties-prefix "msw-"
   :constants-prefix "mswc-")
T
Remarks

Function wrappers created by vlax-import-type-library are available only in the context of the document vlax-import-type-library was issued from.

In the current release of Visual LISP, vlax-import-type-library is executed at runtime, rather than at compile time. In future releases of Visual LISP, this may change. The following practices are recommended when using vlax-import-type-library:

If you want your code to run on different machines, avoid specifying an absolute path in the tlb-file-name parameter.
If possible, avoid using vlax-import-type-library from inside any AutoLISP expression (that is, always call it from a top-level position).
In your AutoLISP source file, code the vlax-import-type-library call before any code that uses method or property wrappers or constants defined in the type library.



Returns a running instance of an application object, or creates a new instance if the application is not currently running

(vlax-get-or-create-object prog-id)

Arguments

prog-id

A string containing the programmatic identifier of the desired ActiveX object. The format of prog-id is

<Vendor>.<Component>.<Version>

For example:

AutoCAD.Drawing.15

Return Values

The object.

Examples

_$ (vlax-get-or-create-object "Excel.Application")
#<VLA-OBJECT _Application 0017bb5c>
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|申请友链|Archiver|手机版|小黑屋|辽公网安备|晓东CAD家园 ( 辽ICP备15016793号 )

GMT+8, 2025-9-27 19:19 , Processed in 0.415157 second(s), 34 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表