Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I can not make an OLE Internet Object visible no manner what I try?

Status
Not open for further replies.

jpstafford

Technical User
Nov 13, 2000
19
0
0
US
Using Visual Foxpro 6.0
I am adding an OLE link to a form to access the HP web site. I can not make this object visible at design or run time.
Thisform.OLEwarrantyUrl.Enabled=.T. &&this is OK, I can change this from .F. to .T.
Thisform.OLEwarrantyUrl.Visible=.F. &&this property stay’s .F. no manner what I try?

1. I created the OLE object via the form designer.
2. In the Insert Object Dialog I selected (Insert Control)
3. Selected Control Type (Microsoft Internet Transfer Control, version 6.0)
4. Right click the mouse over the object and selected (Inet Properties)
a. General Tab:
i. Access Type = 1-icDirect
ii. Proxy = None
iii. Request Timeout = 60
b. URL Tab:
i. URL = ii. Protocol = 4-ichttp
iii. Remote Host = h20000.iv. Remote Port = 80
v. Document = /bizsupport/TechSupport/WarrantyLookup.jsp
vi. The user name and password, I left blank.
Everything looks good except I can not make this object visible. What am I missing here? The application is running on two platform Windows 2000 professional and Window XP professional.
I couldn’t figure this out using my documentation and help file. Any suggestion would be helpful.
 
John,

I answered this in your other thread, but I assume it got deleted. Pity I didn't think to make a copy of my reply.

Can you see the object at design time? It should appear as a black box containing a magnified Windows logo. If not, check that it is not too small to see, or positioned outside the form, or hidden behind another object.

If you can see it at design time but not at run time, add a button to your form. In the click event, write this code:

Code:
thisform.OLEwarrantyUrl.Navigate2("[URL unfurl="true"]www.MyUrl.com")[/URL]
  && put the actual URL in the above code

Run the form and click the button.

If that still doesn't work, come back.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Thanks Mike, I believe that someone erase my previous question, asking me to post it somewhere else?
Anyway, your suggestion didn’t work? I get an error (object doesn’t exist) which is understandable because it is not visible. The property .OLEwarrantyUrl.Visible is False and I can’t change it?
The OLE object that I created OLEwarrantyURL is actually:
Thisformset.war_win.OLEwarrantyUrl.
Also the object OLEwarrantyUrl doesn’t have a native Method name Navigate2.
Code I added to the form button.
Code:
Thisformset.war_win.OLEwarrantyUrl.Navigate2("[URL unfurl="true"]http://h20000.www2.hp.com/bizsupport/TechSupport/WarrantyLookup.jsp")[/URL]

How would you add a link to the HP warranty Center’s web page in a form?
 

John,

OK, I can see what's happening now. I just took a closer look at your code. You were talking about the "OLE Internet object". I assumed you meant the Web Browser control, but I see you are using the Internet Transfer control.

You will definitely not see the Internet Transfer control because it is, by definition, an "invisible" control -- just like, say, a timer. That's why you can't change its Visible property.

Perhaps you could explain what exactly you are trying to achieve. Do you want the user to view the warranty page? If so, you should be using the Web Browser control (including the Navigate2 method). Or you can simply launch an instance of the user's default browser by doing a ShellExecute() on the relevant URL.

Or, do you want to obtain a copy of the warranty page to manipulate in your program? If so, then the Internet Transfer control is the way to go, but you need to call either its Execute or GetURL method.

If you could clarify your requirement, I'll be glad to help further (if I can).

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Here are the requirements. This is a Equipment (Servers) Tracking system. The users need to access the Warranty information from the HP web site on servers. This information can be collected by inputing the servers serial number and Part number into the appropiate fields on the web site.
The web site is:
Code:
[URL unfurl="true"]http://h20000.www2.hp.com/bizsupport/TechSupport/WarrantyLookup.jsp[/URL]
I tried excuting the Execute() and OpenURL() method in the Internet Transfer Control from a button on the form. This didn't launch the transfer control. I suspect I need to add code or pass some parameters, but I know not what, does anyone have a working example?
 

John,

You can't use the Internet Transfer control to programmatically enter data into fields on a web page. What you should do is to call up the page in your browser, enter some sample data in the fields, click the Submit button, and observe the URL of the target page in the browser's address bar. The URL will probably contain a ?, followed by some keywords plus the values you just entered.

Now go back to the Internet Transfer control and do a OpenURL on that URL.

By the way, you don't "launch the transfer control". As I mentioned earlier, you use the control to get the data from a web page into your application -- it's never going to be visible to the user. You just need something like this:

lcWebPage = OpenURL("MyURL")

Hope this makes sense.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Thanks Mike;
I simply want to have my application to open up the Web page so the users can view/use both at the same time (foxpro Equipment Tracking System and HP’s warranty web site). At this time I put the serial number of the equipment into the clipboard very time the user moves from one record to another. Then the user can paste that data into the correct field on the web site and then cut and paste the part number then collect the warranty information. If the user wants that information installed into the Tracking System, it has to be copied and pasted from the web site to the application. So in this scenario all I need is to open up the HP’s warranty web site. I am sure there is a better way, but for now I need to get this into production. How would you accomplish this task?
 
Hi John,

use the Microsoft Webbrowser Control, not the Internet Transfer Control. Put NODEFAULT in the Refresh()-Event of the control. It's a known issue, that it does not work with VFP otherwise. And then you can use the Navigate2() method.

Bye, Olaf.
 
John,

If all you need is to open the warranty web site for the user to view the page, just ShellExecute() the URL (as I suggested at the start of this thread). Here is the code:

Code:
DECLARE INTEGER ShellExecute IN shell32.dll ;
  INTEGER hndWin, ;
  STRING cAction, ;
  STRING cFileName, ;
  STRING cParams, ;
  STRING cDir, ;
  INTEGER nShowWin

ShellExecute(0, "open", "[URL unfurl="true"]www.whatever....",[/URL] "", "", 1)

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Thanks Mike Lewis, That worked great. I will do some research to better understand what is happening when I execute the code you provided for me. I was wondering should there by any clean up code after the user is done with the HP site to free up memory, like maybe:
Code:
Release shellexecute()
 
Mike I found your article on Google about 'Introducing Shellexecute()' and it answers and solve all my current problems. Thanks again Mike :)...John Stafford
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top