投稿日 | : 2005/02/04(Fri) 16:49 |
投稿者 | : たすけて〜 |
Eメール | : |
URL | : |
タイトル | : Inet コントロールについて |
お世話になります。
InetコントロールのExecuteでURL(.cgi)にPOSTでパラメータを渡して、
返ってきた文字列をWebBrowserコントロールで表示しようとしているのですが、
一度目の起動(WwbBrowserが立ち上がっていない時)はうまく行くのですが、
立ち上がってるときに再び同じ処理をしようとすると、
文字列が完全に取得できておらず、うまく表示できません。
どう対処していいかわからずここに質問を投げてみました。
Public gStr As String
Public Function getXML(ByVal strURL As String, ByVal strData As String) As String
Dim strURL As String
Dim strData As String
'POST処理
Call Inet.Execute(strURL, "POST", strData)
DoEvents
'終了まで待つ
Do While LenB(gstrRet) = 0
Call Sleep(100)
DoEvents
Loop
'戻値のセット
getXML = gStr ←文字列が途中までしか取得できていない
End Function
'**********************************************************
' 接続状態変化時の処理
'**********************************************************
Private Sub Inet_StateChanged(ByVal State As Integer)
Dim strBuf As String
Dim strXML As String
If State = icResponseCompleted Then
strBuf = Inet.GetChunk(1024, icString)
Do While LenB(strBuf) > 0
strXML = strXML & strBuf
strBuf = Inet.GetChunk(1024, icString)
Loop
gStr = strXML
End If
End Sub
宜しくお願い致します。