PRB: Problem Occurs When You Call ITC Execute from Form_Load (257853)
The information in this article applies to:
- Microsoft Visual Basic Professional Edition for Windows 5.0
- Microsoft Visual Basic Professional Edition for Windows 6.0
- Microsoft Visual Basic Enterprise Edition for Windows 5.0
- Microsoft Visual Basic Enterprise Edition for Windows 6.0
This article was previously published under Q257853 SYMPTOMS
It may be tempting to call the Execute method of Internet Transfer Control in Form_Load with the intention to send a request automatically. However, the StateChanged subroutine may not get called if the method is called when the form is being loaded.
RESOLUTION
To send a request automatically with the Execute method, you can call the method in Sub Main() and set Sub Main() as the startup object:
- Add a module to the Visual Basic project.
- Add Sub Main() to the module.
- Select Sub Main() as the Startup Object from the project Properties.
- Remove Sub Form_Load from the form.
- Call the Execute method in Sub Main() as follows:
Sub Main()
Load Form1
'Form1.Show
...
Form1.Inet1.Execute ...
End Sub
Modification Type: | Major | Last Reviewed: | 6/17/2002 |
---|
Keywords: | kbhttp kbITC kbprb KB257853 |
---|
|