Page 1 of 1 1
Topic Options
#12678 - 2001-10-01 02:48 PM For the OLE gurus ;)
masken Offline
MM club member
*****

Registered: 2000-11-27
Posts: 1222
Loc: Gothenburg, Sweden
Hi there!

hmm... is it possible to have KiX calling the Windows dialogue for selecting a dir (the standard API thingie with an OK and Cancel button), and read the results (the selected dir)?

Would be damn cool

I know you're out there bryce, cj, shawn, ntdoc, and all the rest

[ 01 October 2001: Message edited by: masken ]

_________________________
The tart is out there

Top
#12679 - 2001-10-01 03:29 PM Re: For the OLE gurus ;)
Shawn Administrator Offline
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
#12680 - 2001-10-01 06:41 PM Re: For the OLE gurus ;)
masken Offline
MM club member
*****

Registered: 2000-11-27
Posts: 1222
Loc: Gothenburg, Sweden
Ah! Thanks for your reply Shawn!

hmm.. unfortunately I haven't gotten this to work quite yet, but i'll keep on trying. I tried the MS VB 6.0 SP5 Redistr. Pack, but that didn't help much, I still get the errorcode:
"ERROR -2147221230 : Klassen är inte licensierad för användning
filename ="

Translated from Swedish "The class is not licensed for use"

But i'll try something else..

_________________________
The tart is out there

Top
#12681 - 2001-10-01 06:55 PM Re: For the OLE gurus ;)
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
I know that I have used the open file dialog box before... it was one of the first things I did when kix2001 came out. Hold on and let me look.

It might have been a WSH object.

Bryce

Top
#12682 - 2001-10-01 07:35 PM Re: For the OLE gurus ;)
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
Shawn.

look under your

HKEY_CLASSES_ROOT\Licenses\F9043C85-F6F2-101A-A3C9-08002B2F49FB

what is the default value?

Top
#12683 - 2001-10-01 07:43 PM Re: For the OLE gurus ;)
Shawn Administrator Offline
Administrator
*****

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

I don't have that key under HKCR\LICENSES ... highest CLSID i've got is F4FC59...

-Shawn

Top
#12684 - 2001-10-01 07:45 PM Re: For the OLE gurus ;)
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
ok, is F9043C85-F6F2-101A-A3C9-08002B2F49FB the CLSID for "MSComDlg.CommonDialog"?

Bryce

Top
#12685 - 2001-10-01 07:54 PM Re: For the OLE gurus ;)
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
It certainly is - you hacker you

-Shawn

Top
#12686 - 2001-10-01 08:04 PM Re: For the OLE gurus ;)
Bryce Offline
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
#12687 - 2001-10-01 08:34 PM Re: For the OLE gurus ;)
Shawn Administrator Offline
Administrator
*****

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

Nope - not me - scary though - I picked up that -Name thingy from Kent ...

-Shawn

Top
#12688 - 2001-10-01 10:02 PM Re: For the OLE gurus ;)
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
hey ya'll!

I foudn a fix
but, it is a 7meg DL from MS
but it is a free DL!


Also, it looks like it might be a very helpful tool.
http://download.microsoft.com/msdownload/sbn/vbcce/vb5ccein.exe

Top
#12689 - 2001-10-02 10:14 AM Re: For the OLE gurus ;)
masken Offline
MM club member
*****

Registered: 2000-11-27
Posts: 1222
Loc: Gothenburg, Sweden
Ok, thx a bunch both Bryce & Shawn! Dunno what's up with that weird mail thingie there but...?

Hmm.. so one has to install this to get it working.. darn it.. I was thinking if having the users selecting a dir for "My Documents" (well, not just that, could be used for many things)

_________________________
The tart is out there

Top
Page 1 of 1 1


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

Who's Online
0 registered and 764 anonymous users online.
Newest Members
ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder, M_Moore
17887 Registered Users

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

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org