#77500 - 2001-04-05 07:26 PM
Re: A question on COM objects.
|
cj
MM club member
   
Registered: 2000-04-06
Posts: 1102
Loc: Brisbane, Australia
|
This is what I found: Enhance Your Apps with Common Dialogs: Part Iand this is the code I tried: code:
break on $dlg=CreateObject("MSComDlg.CommonDialog")
"set title" ? $dlg.DialogTitle = "Get me a File!"
"set filter" ? $dlg.Filter ="Documents|*.doc|Templates|*.dot|Text Files|*.txt" $dlg.FilterIndex=3
"show dialog" ? $dlg.ShowOpen
;"returns" ? $dlg.FileName ?
but nothing happens. What am I doing wrong? cj
|
Top
|
|
|
|
#77501 - 2001-04-05 07:30 PM
Re: A question on COM objects.
|
Shawn
Administrator
   
Registered: 1999-08-13
Posts: 8611
|
ceej:code:
break on$dialog = createobject("MSComDlg.CommonDialog") if $dialog $dialog.filter = "All Files(*.*)|*.*" $dialog.filterindex = 3 $dialog.maxfilesize = 128 $dialog.showopen() endif ?"pause..." gets $k exit
and check to make sure you've got HKCR\MSComDlg.CommonDialog in your registry, not everyone has it! Shawn. [This message has been edited by Shawn (edited 05 April 2001).]
|
Top
|
|
|
|
#77503 - 2001-04-05 08:03 PM
Re: A question on COM objects.
|
cj
MM club member
   
Registered: 2000-04-06
Posts: 1102
Loc: Brisbane, Australia
|
Thanks dude!It was the $dlg.maxfilesize = 128 that did it. When Bryce mentioned Common Dialogs I thought of his show Objects script and went straight to HKCL looking for comdlg, I found mscomdlg and tried it. To get the filename... "Filename = " $dlg.FileName ?
cj [This message has been edited by cj (edited 05 April 2001).]
[This message has been edited by cj (edited 05 April 2001).]
|
Top
|
|
|
|
#77506 - 2001-04-05 08:52 PM
Re: A question on COM objects.
|
Shawn
Administrator
   
Registered: 1999-08-13
Posts: 8611
|
Been doing some more research on this... I suspect that once Kix2001 hits the pavement, lot's of folks might run into this problem... Licensing with IClassFactory2
Read the last three or four paragraphs ! This obviously has nothing to do with KiXtart 2001 per se. If you tried the same thing with VBScript, I imagine you'de get the same error, might want to try it though ! Shawn. [This message has been edited by Shawn (edited 05 April 2001).]
|
Top
|
|
|
|
#77507 - 2001-04-05 10:07 PM
Re: A question on COM objects.
|
cj
MM club member
   
Registered: 2000-04-06
Posts: 1102
Loc: Brisbane, Australia
|
Bryce, here is a REGDMP of some of my keys:
code:
C:\scripts>regdmp \registry\machine\software\classes\mscomdlg.commondialog \registry\machine\software\classes\mscomdlg.commondialog = Microsoft Common Dialog Control, version 6.0 CLSID = {F9043C85-F6F2-101A-A3C9-08002B2F49FB} CurVer = MSComDlg.CommonDialog.1
C:\scripts>regdmp \registry\machine\software\classes\mscomdlg.commondialog.1
\registry\machine\software\classes\mscomdlg.commondialog.1 = Microsoft Common Dialog Control, version 6.0 CLSID = {F9043C85-F6F2-101A-A3C9-08002B2F49FB}
C:\scripts>regdmp \registry\machine\software\classes\clsid\{F9043C85-F6F2-101A-A3C9-08002B2F49FB}
\registry\machine\software\classes\clsid\{F9043C85-F6F2-101A-A3C9-08002B2F49FB} = Microsoft Common Dialog Control, version 6.0 CONTROL = COMMON DIALOGS CONTROL Implemented Categories {0DE86A52-2BAA-11CF-A229-00AA003D7352} {0DE86A53-2BAA-11CF-A229-00AA003D7352} {0DE86A57-2BAA-11CF-A229-00AA003D7352} {40FC6ED4-2438-11CF-A3DB-080036F12502} {40FC6ED5-2438-11CF-A3DB-080036F12502} {7DD95802-9882-11CF-9FA9-00AA006C42C4} INPROCSERVER = C:\WINNT\System\COMDLG16.OCX InprocServer32 = C:\WINNT\System32\COMDLG32.OCX ThreadingModel = Apartment MISCSTATUS = 0 1 = 132499 PROGID = MSComDlg.CommonDialog.1 Programmable TOOLBOXBITMAP = C:\WINNT\System\COMDLG16.OCX, 1 ToolboxBitmap32 = C:\WINNT\System32\COMDLG32.OCX, 1 TYPELIB = {F9043C88-F6F2-101A-A3C9-08002B2F49FB} VERSION = 1.2 VersionIndependentProgID = MSComDlg.CommonDialog
how does this compare to yours?
cj
[This message has been edited by cj (edited 05 April 2001).]
|
Top
|
|
|
|
#77508 - 2001-04-05 11:23 PM
Re: A question on COM objects.
|
Bryce
KiX Supporter
   
Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
|
So in order to develop software that uses some some of the built in COM objects, you have to purchase a license!!!! cj, there are some differences.
code:
U:\>regdmp \registry\machine\software\classes\mscomdlg.commondialog\registry\machine\software\classes\mscomdlg.commondialog = Microsoft Common Dialog Control, version 6.0 CLSID = {F9043C85-F6F2-101A-A3C9-08002B2F49FB} CurVer = MSComDlg.CommonDialog.1 U:\>regdmp \registry\machine\software\classes\mscomdlg.commondialog.1
\registry\machine\software\classes\mscomdlg.commondialog.1 = Microsoft Common Dialog Control, version 6.0 CLSID = {F9043C85-F6F2-101A-A3C9-08002B2F49FB} U:\>regdmp \registry\machine\software\classes\clsid\{F9043C85-F6F2-101A-A3C9-08002B2F49FB} \registry\machine\software\classes\clsid\{F9043C85-F6F2-101A-A3C9-08002B2F49FB} = Microsoft Common Dialog Control, version 6.0 Control Implemented Categories {0DE86A52-2BAA-11CF-A229-00AA003D7352} {0DE86A53-2BAA-11CF-A229-00AA003D7352} {0DE86A57-2BAA-11CF-A229-00AA003D7352} {40FC6ED4-2438-11CF-A3DB-080036F12502} {40FC6ED5-2438-11CF-A3DB-080036F12502} {7DD95802-9882-11CF-9FA9-00AA006C42C4} InprocServer32 = C:\WINNT\system32\COMDLG32.OCX ThreadingModel = Apartment MiscStatus = 0 1 = 132499 ProgID = MSComDlg.CommonDialog.1 Programmable ToolboxBitmap32 = C:\WINNT\system32\COMDLG32.OCX, 1 TypeLib = {F9043C88-F6F2-101A-A3C9-08002B2F49FB} Version = 1.2 VersionIndependentProgID = MSComDlg.CommonDialog
Bryce
------------------ kix.isorg.net
|
Top
|
|
|
|
Moderator: ShaneEP, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Ruud van Velsen, Mart
|
1 registered
(Allen)
and 509 anonymous users online.
|
|
|