TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: cjw on January 04, 2015, 08:46:42 AM

Title: MS common dialog box in lisp(win8 AutoCAD2012 doesn't work)
Post by: cjw on January 04, 2015, 08:46:42 AM
MS common dialog box in lisp
http://www.theswamp.org/index.php?topic=8405.0

Quote
(setq mscd (vlax-create-object "MSComDlg.CommonDialog")) ;create the object
(vlax-put-property mscd "Filename" "*.*") ;set the file filters
(vlax-put-property mscd "MaxFileSize" 10000) ;set the maximum size of the filename
(vlax-put-property mscd "Flags" 524800) ;set the dialog flags (you can find these in the API reference)
(vlax-put-property mscd "Action" 1) ;set the action of the dialog ... i.e. invoke it as "Open File"
(setq strFileName (vlax-get-property mscd "Filename"))

win8
AutoCAD 2008 work
_$ (setq mscd (vlax-create-object "MSComDlg.CommonDialog"))
#<VLA-OBJECT ICommonDialog 098a45d8>

AutoCAD 2012 doesn't work
_$ (setq mscd (vlax-create-object "MSComDlg.CommonDialog"))
nil

Any idea is appreciated. Thanks.
Title: Re: MS common dialog box in lisp(win8 AutoCAD2012 doesn't work)
Post by: cjw on January 05, 2015, 08:47:30 PM
I think I found the answer

http://stackoverflow.com/questions/13877267/open-file-dialog-that-works-with-win7
https://social.technet.microsoft.com/Forums/scriptcenter/en-US/a3b358e8-15ae-4ba3-bca5-ec349df65ef6/windows7-vbscript-open-file-dialog-box-fakepath?forum=ITCG
http://www.qlikcommunity.com/thread/68470