Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

text box question

Posted on 2001-08-15
4
Medium Priority
?
165 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 27

Accepted Solution

by:
kretzschmar earned 400 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

604 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