开发者

If I open url in IE, it works. But if I open same url by api “InternetOpenUrl” then it returns nil. I don't understand what's the reason?

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.as开发者_C百科hx?SERVICE=WMS&STYLES=&BBOX=-8734904.9955321327,4935096.5230968799,-8659096.1018777788,5002463.5331088305&WIDTH=256&HEIGHT=256&REQUEST=GetMap&TRANSPARENT=false


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;


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜