Page 1 of 1 1
Topic Options
#77499 - 2001-04-05 04:27 PM A question on COM objects.
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
For the past few days I have been digging arround in Microsoft's MSDN site.

What I was wondering how hard would it be to access the Windows Common Controls(Comctl32.dll).

What I was looking for was a way to create GUI interfaces using API calls. Just can't figure out what class.object to call... OR if this is even possible.

Bryce

------------------
kix.isorg.net

Top
#77500 - 2001-04-05 07:26 PM Re: A question on COM objects.
cj Offline
MM club member
*****

Registered: 2000-04-06
Posts: 1102
Loc: Brisbane, Australia
This is what I found: Enhance Your Apps with Common Dialogs: Part I

and 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 Offline
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
#77502 - 2001-04-05 08:00 PM Re: A question on COM objects.
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
I have it on my 2000 and NT computers.

------------------
kix.isorg.net

Top
#77503 - 2001-04-05 08:03 PM Re: A question on COM objects.
cj Offline
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
#77504 - 2001-04-05 08:04 PM Re: A question on COM objects.
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
but i get the following errors

@serror=Class is not licensed for use
@error=-2147221230

when i try to

createobject("MSComDlg.CommonDialog")

Bryce

------------------
kix.isorg.net

Top
#77505 - 2001-04-05 08:29 PM Re: A question on COM objects.
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Bryce:

How desperate are you like to get this work ?

Microsoft introduced a new version of IClassFactory (the standard COM interface use to create COM objects) called IClassFactory2.

IClassFactory2 allows COM object developers to enforce licensing restrictions when creating objects.

Want to try and hack it ?

Shawn.

Top
#77506 - 2001-04-05 08:52 PM Re: A question on COM objects.
Shawn Administrator Offline
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 Offline
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 Offline
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
#77509 - 2001-04-05 11:54 PM Re: A question on COM objects.
cj Offline
MM club member
*****

Registered: 2000-04-06
Posts: 1102
Loc: Brisbane, Australia
Here are the differences: This is my dump with some bits bolded. You don't have those bits.

code:

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
= 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



cj



Top
#77510 - 2001-04-06 05:36 PM Re: A question on COM objects.
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
nope, still the same errors

Bryce

Top
Page 1 of 1 1


Moderator:  ShaneEP, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 509 anonymous users online.
Newest Members
min_seow, Audio, Hoschi, Comet, rrosell
17881 Registered Users

Generated in 0.136 seconds in which 0.101 seconds were spent on a total of 12 queries. Zlib compression enabled.