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

x
?
Solved

Equal Sign in URL causes problems when using ShellExecute

Posted on 2004-07-30
3
Medium Priority
?
450 Views
Last Modified: 2010-04-05
I typically use the following statement to launch a new instance of an Internet Explorer browser pointed to a specific URL address (strURL):

ShellExecute(Application.MainForm.Handle, 'open', 'explorer.exe', PChar(strURL), nil, SW_SHOW);

In most cases this works fine, however I have come across a case that does not work.
If the URL contains an equal sign in the URL string, the browser will not load and I get the following error message:
"The path 'test' does not exist or is not a directory. "

In the above case the particular strURL contains the following string:
strURL := 'http://www.google.com/groups?as_q=test';

It appears that the equal sign is causing the string to be divided perhaps.
I've tried substituting %3D in place of the equal sign with no success.
I would appreciate any help anyone could offer.

Thanks,
ilmds123
0
Comment
Question by:ilmds123
[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
  • 2
3 Comments
 
LVL 4

Expert Comment

by:JeePeeTee
ID: 11680631
some character are not allowed. make use of this routine to solve your url problem

function URLEncode(const ASrc: string): string;
var
  i: Integer;
begin
  Result := '';
  for i := 1 to Length(ASrc) do
  begin
    if ASrc[i] = ' ' then
    begin
      Result := Result + '+';
    end else if NOT (ASrc[i] in ['A'..'Z', 'a'..'z', '0'..'9']) then
    begin
      Result := Result + '%' + IntToHex(Ord(ASrc[i]), 2);
    end else
    begin
      Result := Result + ASrc[i];
    end;
  end;
end;
0
 
LVL 4

Accepted Solution

by:
JeePeeTee earned 2000 total points
ID: 11680739
Forgot my 1st mail....

but make use of " arround your string so.....

strURL:= '"http://www.google.com/groups?as_q=test"';

... that it will solve your problem.
0
 

Author Comment

by:ilmds123
ID: 11680784
JeePeeTee,

The missing quotes was the problem. Thanks so much!

ilmds123
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone 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

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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

596 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