WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Netscape

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

OLE Automation and Netscape

Keywords: OLE automation netscape

Note: This example shows how to use Ole Automation to drive Netscape to obtain a web page. If what you are really trying to do is to obtain web pages, then a better solution might be to try our Internet Winsock extender, which can be downloaded from our Web site, under the WIL Add-ons section of the download page.

For compiled EXEs, you need to get (from Winbatch system directory) the OLE DLL (WBOxx34I.dll for 32 bit operation). If you are compiling the BIG exe model, you need to add the "Ole Extender" or whatever the similiar on is.

If you are using the small (network) model, you need to copy the above file(s) to the same directory as the compiled WinBatch exe.


BoxOpen("Object Open Example","Initializing")
url = "http://www.windowware.com/index.html"
bufsize = 100000   

ErrorMode(@off)
LastError()
web = ObjectOpen("Netscape.Network.1")
err=LastError()
ErrorMode(@cancel)
if err!=0
    Message("Netscape not found","Cannot run this sample program")
    exit
endif

BoxText("Opening Netscape Object")
TimeDelay(2)
outfile=strcat(DirGet(),"oletest.html")
bigbuf=BinaryAlloc(bufsize)
BinaryOleType(bigbuf,202,0,0,0)

rc = web.Open(url, 0, 0, 0, 0)	

BoxText(strcat("Retrieving url contents of",@crlf,url))


if rc!=0
   While !(web.IsFinished)
      contsize=web.GetContentLength
      if contsize==0
	 TimeDelay(1)
       else
	  getnowsize=min(bufsize,contsize)
	  gotsize=web.Read(bigbuf,getnowsize)
	  BinaryEODSet(bigbuf,gotsize)
	  break
       endif
   endwhile
   BinaryWrite(bigbuf,outfile)

else
  Message("Uh-oh", "web.Open failed")
endif



web.Close

BoxText("Complete")
Message("OLE Test", strcat("Finished",@crlf,"Data saved in",@crlf,outfile))

More OLE with Netscape-Related Questions:

Question:

I get "1258: ole: name not found" when executing Netscape functions GetPassword(), SetUsername(), and SetPassword(). Any ideas?

Here is the web site with the documentation re: OLE for Netscape


http://www.mcom.com/newsref/std/oleapi.html
This can also be found in the Netscapes site ...

I cut and pasted the Winbatch example, as is, then after the object open, but prior to the web.Open, I've added:


c = web.GetPassword() ... 
the other functions give the same error (the Winbatch example works as advertised; I now want to use Netscape's capabilities to connect to a secure site).

The documentation for Get Password indicates that it will return a null string if the password has not yet been set. Therefore, it should return a null string.

The 'set password' command fails with the same error as the 'get password'.

Answer:

OK, I don't think you can get a password until you set a password. After you set it, then you can get it.

Secure sites begin: https.

Try:


	web.SetPassword("xyz123")
	web.SetUsername("John") 

	c = web.GetPassword()
I think we need the () on the end of getpassword to recognize it as a function.
Article ID:   W13672
Filename:   OLE Automation and Netscape.txt
File Created: 2001:03:01:13:24:20
Last Updated: 2001:03:01:13:24:20