I think nobody will "compile in head" so big piece of code. Try to split it or to replace some code by description.

And write your "uses" section. For example, what is "hInternet"? Where did you get it?

And then, probably, it would be easier to answer your question.