Timeout API function
I've created a class module which can open a connection to a FTP server.
The only problem I have is when the user set an invalid server. Sometime the function OpenConnection returns 0, so I know the server doesn't exists or an error occured and I show a message. (this works)
But, sometime the connection do NOT return anything, it hungs up and I have to restart VB. :SICK:
I read that the TIMEOUT of WinInet doesn't always work at http://support.microsoft.com/kb/176420/en-us.
So, I'm not sure that the function InternetSetOption with flag INTERNET_OPTION_CONNECT_TIMEOUT will work.
How can I stop the execution of the API function OpenConnection if it is not accomplished after some seconds (about 10s)? :confused:
If you have an others ideas to avoid this problem, let me know them.
Maybe using multithreading? But still I need the address of a function that is in a class module.
Sorry for my english, I speak Polish and French and I'm only 16 (Don't look at my age if you submit a hard code :D ).

