tags:

views:

58

answers:

2

If I open mentioned url in IE, it works. But if I open same url by api “InternetOpenUrl” then it returns nil.

url is

http://gisservices.datadoors.net/wmsc/__streaminguid.44d023f0-447c-4378-9624-858cd90bb045/wms-c.ashx?SERVICE=WMS&STYLES=&BBOX=-8734904.9955321327,4935096.5230968799,-8659096.1018777788,5002463.5331088305&WIDTH=256&HEIGHT=256&REQUEST=GetMap&TRANSPARENT=false
A: 

Doesn't look like a valid url to me. it doesn't start with a protocol and has unescaped special chars like : and > in it.

Internet explorer probably fixes the url in the frontend, and InternetOpenUrl doesn't.

CodeInChaos
+1  A: 

i check your url and is valid (and returns an jpg image), maybe you are not calling the InternetOpen function before to use the InternetOpenUrl function.

Check this sample to see how to use the InternetOpenUrl function.

var
  hInet     : HINTERNET;
  hFile     : HINTERNET;
begin
  hInet  := InternetOpen(nil, INTERNET_OPEN_TYPE_PRECONFIG,nil,nil,0);
  hFile  := InternetOpenURL(hInet,PChar(url),nil,0,0,0);
  try
    if Assigned(hInet) and Assigned(hFile) then
    begin
         //do your stuff here
    end;
  finally
    if Assigned(hFile) then
    InternetCloseHandle(hFile);
    if Assigned(hInet)  then
    InternetCloseHandle(hInet);
  end;
end;
RRUZ