明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 922|回复: 5

[讨论] 如何调用64位的多文件选择框

[复制链接]
发表于 2015-7-8 16:14:21 | 显示全部楼层 |阅读模式


  1. *
  2. ' *   commdlg.h -- This module defines the 32-Bit Common Dialog APIs      *

  3. Type OPENFILENAME
  4.         lStructSize As Long
  5.         hwndOwner As Long
  6.         hInstance As Long
  7.         lpstrFilter As String
  8.         lpstrCustomFilter As String
  9.         nMaxCustFilter As Long
  10.         nFilterIndex As Long
  11.         lpstrFile As String
  12.         nMaxFile As Long
  13.         lpstrFileTitle As String
  14.         nMaxFileTitle As Long
  15.         lpstrInitialDir As String
  16.         lpstrTitle As String
  17.         flags As Long
  18.         nFileOffset As Integer
  19.         nFileExtension As Integer
  20.         lpstrDefExt As String
  21.         lCustData As Long
  22.         lpfnHook As Long
  23.         lpTemplateName As String
  24. End Type

  25. Declare Function GetOpenFileName Lib "comdlg32.dll" Alias "GetOpenFileNameA" (pOpenfilename As OPENFILENAME) As Long

  26. Declare Function GetSaveFileName Lib "comdlg32.dll" Alias "GetSaveFileNameA" (pOpenfilename As OPENFILENAME) As Long

  27. Declare Function GetFileTitle Lib "comdlg32.dll" Alias "GetFileTitleA" (ByVal lpszFile As String, ByVal lpszTitle As String, ByVal cbBuf As Integer) As Integer
AutoCAD 2012 时,win7 用的是64位的,发现(setq WINDLG (vlax-create-object "MSComDlg.CommonDialog")) 返回为nil

想用  WIN32API ,发现还是不行。

http://bbs.mjtd.com/thread-85724-1-1.html
http://bbs.mjtd.com/forum.php?mo ... mp;extra=#pid737820

      (setq name "C:\\DynWrapX.dll")
      (setq wsh (vlax-Create-Object "wscript.shell"))
      (vlax-invoke wsh 'Run (strcat "RegSvr32.exe " name))
      (setq wrap (vlax-create-object "DynamicWrapperX"))

wrap返回的是nil
AutoCAD2012 64位的时候,好像还是不行
"觉得好,就打赏"
还没有人打赏,支持一下
 楼主| 发表于 2015-7-8 16:20:59 | 显示全部楼层
API 什么的,不是太懂。
想问一下,有没有可能调用像AutoCAD自身在使用的多文件选择框?
不管是64位还是32位。

http://wangye.org/blog/archives/551/
找了很久,一直无果。
发表于 2015-7-8 23:51:19 | 显示全部楼层
本帖最后由 zzyong00 于 2015-7-8 23:52 编辑

64位系统 64位cad,在vba用API调用文件选择对话框,简直是恶梦,至今未成功,只有一个调用文件夹选择对话框成功过
 楼主| 发表于 2015-7-9 08:17:44 | 显示全部楼层
目前是先用opendcl替代,ARX好是好,就是有版本的问题,CAD版本一变,就得更新。
发表于 2015-7-9 09:45:04 | 显示全部楼层
(defun qf_getFolder (msg / WinShell shFolder path catchit)
  (vl-load-com)
  (setq winshell (vlax-create-object "Shell.Application"))
; (vlax-dump-object winshell T)
  (setq shFolder (vlax-invoke-method WinShell 'BrowseForFolder 0 msg 1))
  (setq
    catchit (vl-catch-all-apply
      '(lambda ()
(setq shFolder (vlax-get-property shFolder 'self))
(setq path (vlax-get-property shFolder 'path))
       )
    )
  )
  (if (vl-catch-all-error-p catchit)
    nil
    path
  )
)

哪位大侠写的,忘了
 楼主| 发表于 2015-7-9 09:57:30 | 显示全部楼层
本帖最后由 carrot1983 于 2015-7-9 10:07 编辑

文件夹选择的,很早就有了,作用不太人性化。

http://www.mjtd.com/function/info-129-369.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2025-5-21 19:44 , Processed in 0.281870 second(s), 28 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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