Solved

text box question

Posted on 2001-08-15
4
157 Views
Last Modified: 2010-04-06
this is the code im using at the moment ShellExecute(Handle, 'open',
  'Http://www.yahoo.co.uk',nil,nil, SW_SHOWNORMAL);


which works fine however i want to get it to read the url
from a edit box when i put
ShellExecute(Handle, 'open',
  'Http://'+edit1.text,nil,nil, SW_SHOWNORMAL);
it doesent work neither does


ShellExecute(Handle, 'open',
  edit1.text,nil,nil, SW_SHOWNORMAL);
0
Comment
Question by:catbecks
4 Comments
 
LVL 27

Accepted Solution

by:
kretzschmar earned 100 total points
ID: 6388187
try this change (pchar-type is needed, you can do this via conversion)
ShellExecute(Handle, 'open',PCHAR( 'Http://'+edit1.text),nil,nil, SW_SHOWNORMAL);
                     
0
 

Expert Comment

by:david-johnstone
ID: 6388194
What you need to do is cast the string returned from the edit box as a PChar, so the statement becomes


ShellExecute(Handle, 'Open', PChar('http://' + edit1.Text), nil, nil, SW_SHOWNORMAL);

or

ShellExecute(Handle, 'open', PChar(edit1.Text), nil, nil, SW_SHOWNORMAL);

That should sort it out.

David.
0
 
LVL 5

Expert Comment

by:scrapdog
ID: 6388200
ShellExecute(Handle, 'open', PChar(edit1.text), nil, nil, SW_SHOWNORMAL);

0
 
LVL 3

Expert Comment

by:VSF
ID: 6388473
too late guys
Meikl was the fastest!

VSF
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now