Page 1 of 1 1
Topic Options
#85092 - 2002-02-07 06:11 PM Com / VBS call to inputbox
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
there is some VBS code to call an input box in the script forum.

Can the input box be com'd???

_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#85093 - 2002-02-07 08:14 PM Re: Com / VBS call to inputbox
Alex.H Offline
Seasoned Scripter

Registered: 2001-04-10
Posts: 406
Loc: France
The inputbox is internal to VB. It may be possible to call it from WSH through COM, but didn't try it
_________________________
? getobject(Kixtart.org.Signature)

Top
#85094 - 2002-02-11 04:59 AM Re: Com / VBS call to inputbox
cj Offline
MM club member
*****

Registered: 2000-04-06
Posts: 1102
Loc: Brisbane, Australia
Here is some com code to use the File Open dialog. It is taken from TicTacToe and may need some tweaking. You can see the KiX3.63 code commented.

code:

$dlgNet=createobject("MSComDlg.CommonDialog") ; access MS Common Dialog collection
;$dlgNet=olecreateobject("MSComDlg.CommonDialog")
if $dlgNet=0
color r+/n "You cannot access the MSComDlg.CommonDialog Object!" color w/n
$netfile=""
else ; use Dialog box
$dlgNet.Filter="HTML TicTacToe Game Files|*.ttt"
;$=oleputproperty($dlgNet, "Filter", "s", "HTML TicTacToe Game Files|*.ttt")
$dlgNet.FilterIndex=3
;$=oleputproperty($dlgNet, "FilterIndex", "s", "3")
$dlgNet.Filename=$netpath+"\*.ttt" ; look for all .ttt files in $netpath
;$=oleputproperty($dlgNet, "Filename", "s", $netpath+"\*.ttt")
$dlgNet.DialogTitle="Connect to Network Game"
;$=oleputproperty($dlgNet, "DialogTitle", "s", "Connect to Network Game")
$dlgNet.MaxFileSize=128
;$=oleputproperty($dlgNet, "MaxFileSize", "s", "128")
$dlgNet.ShowOpen() ; show the FILE OPEN dialog
;$=olecallfunc($dlgNet, "ShowOpen")
$netfile=$dlgNet.filename
;$netfile=olegetproperty($dlgNet, "filename")
endif

This uses the MS Common Dialogs object which, I believe, has File Open, Printing, Font Selectors and other dialogs. Perhaps one of these is a standard Input box. If you find out, please let us know

cj

Top
#85095 - 2002-02-11 05:32 AM Re: Com / VBS call to inputbox
cj Offline
MM club member
*****

Registered: 2000-04-06
Posts: 1102
Loc: Brisbane, Australia
Here you go: HLP file of MSCommonDialogs control.

cj

Top
#85096 - 2002-02-11 02:11 PM Re: Com / VBS call to inputbox
Alex.H Offline
Seasoned Scripter

Registered: 2001-04-10
Posts: 406
Loc: France
Cj,
The MSComDlg you used is the ocx version, comming from VB. On opposite to the MSComDlg.dll version that can only be called by API, the ocx doesn't need value given as pointer, so it can be used with Kixtart but i'm not sure it can be used on any computer :
the ocx version need some special informations to be bind as a new component, and so may refuse to work on a computer that don't have Visual Basic or any part of Visual Studio v5/v6 such as Visual C++.
On Visual Basic project, when you add the ocx within, the project also gains all needed information to initialize it on any computer, and so the final program.

To get back on Inputbox, it's not a part of the common dialog library.

Just an idea as-is :
$Result=createobject("wsh.application").inputbox("This is a test","test caption")
Does this work ?

_________________________
? getobject(Kixtart.org.Signature)

Top
Page 1 of 1 1


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

Who's Online
0 registered and 2220 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.052 seconds in which 0.029 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