Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

InternetOpenUrl: how to increase timeout?

Avatar of dirkil2
dirkil2 asked on
DelphiWeb BrowsersNetworking
5 Comments1 Solution3614 ViewsLast Modified:
In my Delphi program I need to download a file. Since when the request arrives it takes some time for the server to compile the data to download it could happen that the client has to wait for some time. Unfortunately, my client doesn't wait long enough and the call to InternetOpenUrl returns error code 12002.

Therefore my question: how can I increase the time allowed to wait for the InternetOpenUrl call to return?

See attached code for details.

hSession := InternetOpen('MyApp', INTERNET_OPEN_TYPE_PRECONFIG, nil, nil, 0);
  if not Assigned(hSession) then Exit;
    hService := InternetOpenUrl(hSession, PChar(aUrl), nil, 0, 0, 0);
    if not Assigned(hService) then
      FErrorText := SysErrorMessage(GetLastError);

Avatar of dirkil2

Our community of experts have been thoroughly vetted for their expertise and industry experience.

This problem has been solved!
Unlock 1 Answer and 5 Comments.
See Answers