Re: vbscript navigate2 safearray
- From: Christoph Nolte <Christoph Nolte@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 23 Dec 2005 09:39:01 -0800
Hi Sam,
although I too wonder why Microsoft made it so difficult, it is possible to
create a SafeArray (VT_ARRAY|VT_UI1) in VBScript through COM objects such as
ADODB [1]. Also, if you have objects like XMLHTTP, ServerXMLHTTP or WinHttp
available, you don't even need the somewhat bloated
InternetExplorer.Application object to post data anymore [2].
I also needed to do an HTTP POST in a project and decided to go with the IE
object solution for now. To make usage easy, the code I wrote is encapsulated
in a separate class named WebForm [3].
Regards,
Christoph
[1] http://www.motobit.com/tips/detpg_uploadvbsie/
[2] http://www.motobit.com/tips/detpg_post-binary-data-url/
[3] http://vbs.mooo.com/webform.vbs
"jain.samit@xxxxxxxxx" wrote:
> Hi,
>
> thanks for your reply. So why did microsoft make it so impossible to
> construct a simple form post fields? I cant seem to understand the
> explaination behnd it :(
>
>
> mr_unreliable wrote:
> > hi Sam,
> >
> > Good Luck with this one.
> >
> > afaik, a SafeArray would be impossible to create via script,
> > and it looks very difficult from visual basic.
> >
> > If you are interested in the vb code, you can find (one example)
> > here:
> >
> > http://www.freevbcode.com/ShowCode.Asp?ID=3519
> >
> > You could use that code from script, if you wrap it into some
> > sort of actX object (ocx or dll), and return a (variant) pointer
> > to the SafeArray you created.
> >
> > There is some similar code on Steve McMahon's vbaccelerator
> > website.
> >
> > It may be possible to find an already pre-programmed object
> > to use, if you sniff around the web code development sites.
> > However, I couldn't find one.
> >
> > cheers, jw
> > ____________________________________________________________
> >
> > You got questions? WE GOT ANSWERS!!! ..(but,
> > no guarantee the answers will be applicable
> >
> >
> >
> >
> > jain_sams wrote:
> > > Hi,
> > >
> > > I am trying to do a form post in vbs using navigate2 method, but I have
> > > not been able to set the form parameters.
> > >
> > > The specification says that the form paramters in POST method need to
> > > be in encoded in a SafeArray data type. But there is not much
> > > documentation available on this data type. HOw can we construct a
> > > SafeArray data type.
> > > THis is what I have until now:
> > >
> > > Set WSHShell = WScript.CreateObject("WScript.Shell")
> > > Set IE = CreateObject("InternetExplorer.Application")
> > >
> > > Header = "Content-Type: application/x-www-form-urlencoded" &
> > > Chr(10) & Chr(13)
> > > formParams = "a=b&c=d"
> > > IE.Navigate2 url, Nothing, Nothing, formParams, Header
> > >
> > > formParams needs to be of SafeArray data type. Could someone give some
> > > example code how this type is constructed? A simple example of a
> > > navigate2 post would be even better!
> > > This is a part of a big script and I seem to be wasting too much time
> > > on this part.
> > >
> > >
> > > thanks,
> > > Sam
> > >
> > >
> > >
> > > --
> > > jain_sams
> > > ------------------------------------------------------------------------
> > > Posted via http://www.codecomments.com
> > > ------------------------------------------------------------------------
> > >
>
>
.
- Prev by Date: Re: Script to set Recycled Bin properties
- Next by Date: HTML DropDown Menu and VBSCRIPT
- Previous by thread: A Christmas Present (that you didn't ask for)...
- Next by thread: HTML DropDown Menu and VBSCRIPT
- Index(es):