#12679 - 2001-10-01 03:29 PM
Re: For the OLE gurus ;)
|
Shawn
Administrator
   
Registered: 1999-08-13
Posts: 8611
|
masken,here's a script (RC3) that calls the ms common dialog activex control for picking a filename, it can also be used for picking a printer and choosing a font ... problem is - you need one of the ms visual studio development packages installed before you can use it - like vb or c++ ... I'm wondering if the vb runtimes would be enough ? Give it a try anyway - if the object create fails, it will pump-out an @ERROR message ... code:
break on $Filename = OpenCommonDialog("All files (*.*)|*.*", "Open file", "c:\", "",0)
?"filename = " $Filename
exit
Function OpenCommonDialog($Filter,$Title,$Directory,$Extension,$FileMustExist) $OpenCommonDialog = "" $Dialog = CreateObject("MSComDlg.CommonDialog") If @error = 0 $Dialog.Filter = $Filter $Dialog.DialogTitle = $Title $Dialog.InitDir = $Directory $Dialog.Extension = $Extention $Dialog.MaxFileSize = 128 If $FileMustExist $Dialog.Flags = 4096 EndIf $Dialog.ShowOpen() $OpenCommonDialog = $Dialog.Filename Else ?"ERROR @ERROR : @SERROR" EndIf EndFunction
-Shawn
|
|
Top
|
|
|
|
#12686 - 2001-10-01 08:04 PM
Re: For the OLE gurus ;)
|
Bryce
KiX Supporter
   
Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
|
Still looking... but on a side note, Shawn, is this you? quote:
Date: Mon, 4 Oct 1999 17:35:08 -0700 From: "Shawn A. VanNess" <[PRIVACY PROTECTION]> Subject: Ann: CComTSTR (read this if you hate the USES_CONVERSION macro)This handly litte class wrapps a null-terminated string of TCHARs. I find it fosters slightly prettier code than the USES_CONVERSION stuff. Usage is straightforward... Note that, unlike CComBSTR, there is no operator& overload, as few Win32 APIs take a TCHAR** as an argument. However, like CComBSTR's operator BSTR(), there is an operator TCHAR*(). Example... CComTSTR t = myVariant.bstrVal; editbox.SetWindowText(t); Warning -- I haven't tested this with any MBCS projects. Use it at your own risk, and let me know if you have any problems or suggestions. -Shawn
I found it here http://faqchest.dynhost.com/msdn/ATL/atl-99/atl-9910/atl-991000/atl99100517_01719.html
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 492 anonymous users online.
|
|
|