dcsimg
October 18, 2018
Hot Topics:

Using the Internet Transfer Control: Part 2

  • November 20, 2002
  • By Sam Huggill
  • Send Email »
  • More Articles »

The best way to get to know the Inet controls constants is to look at it using the Object Browser. To do this, load up VB and add the Inet control to a form (Project, Components, Microsoft Internet Transfer Control). Now Click View, Object Browser (or press F2). From the combo box select InetCtlsObjects. You can now look through the different constants; Access constants, Data Type constants, Error constants, Protocol constants and State constants. 

To start with, we are mainly interested in the State constants. To see what each constant means, I have described them below (the number in brackets is the constants actual value):

  • icConnected (4) - Connected
  • icConnecting (3) - Connecting
  • icDisconnected (10) - Disconnected
  • icDisconnecting (9) - Disconnecting
  • icError (11) - An error has occurred
  • icHostResolved (2) - The remote address given has been accepted
  • icNone (0) - No current state
  • icReceivingResponse (7) - A response is current being received
  • icRequesting (5) - Data is currently being requested
  • icRequestSent (6) - A data request has been sent
  • icResolvingHost (1) - The remote address given is currently being checked
  • icResponseCompleted (12) - A response was successfully completed
  • icResponseReceived (8) - A response has been received

OK. I won't go through and describe them all, but I will point out some of the more useful ones. First of all, icConnected provides you with a failsafe way of knowing that you are connected to a remote machine. As icDisconnected also provides you with a way of knowing when you are offline. Probably the most useful constant is icError. This tells us that an error has occurred. We can now check using the ErrorConstants for the actual error that has occurred.





Page 2 of 4



Comment and Contribute

 


(Maximum characters: 1200). You have characters left.

 

 


Enterprise Development Update

Don't miss an article. Subscribe to our newsletter below.

By submitting your information, you agree that developer.com may send you developer offers via email, phone and text message, as well as email offers about other products and services that developer believes may be of interest to you. developer will process your information in accordance with the Quinstreet Privacy Policy.

Sitemap

Thanks for your registration, follow us on our social networks to keep up-to-date