Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
MSInet - MS Internet Transfer Control ActiveX control v6
Message
 
To
05/05/2005 16:20:08
General information
Forum:
Visual FoxPro
Category:
Internet applications
Miscellaneous
Thread ID:
01011428
Message ID:
01011849
Views:
15
I was doing some stuff with MSDOM Extensions. Greg (see msg # 975257) pointed out this extension for HTTP post. He offered a link in one to a bunch of others. They may be one alternative.

I think the win Inet is great - THe "state-12" was an issue. Sample of some "statechanged" event code:
*** ActiveX Control Event ***
LPARAMETERS state
do case
case state = 0
     StateMsg=[No Change in state]
case state = 1
     StateMsg=[Looking up FTP Site DNS IP address]     
case state = 2
     StateMsg=[Successfully located DNS server]
case state = 3
     StateMsg=[Connecting to host computer]
case state = 4
     StateMsg=[Successfully connected to host computer]
case state = 5
     StateMsg=[Sending request to host computer]
case state = 6
     StateMsg=[Successfully sent request to host computer]
case state = 7
     StateMsg=[Receiving response from host computer]
case state = 8
     StateMsg=[Successfully received response from host computer]
case state = 9
     StateMsg=[Disconnecting from host computer]
case state = 10
     StateMsg=[Successfully disconnected from host computer]
case state = 11
     StateMsg=[Error in host communications]
otherwise &&case state = 12
     StateMsg=[The request is complete and all data received]
EndCase
* THe code below "had" a section that sent each chunks
* state message to a list * browser. A "SUCCESS" message
* was published to someotherstring. When 12 was hit, this
* is how I cleaned it up.
* Micheal wrote an excellent article back in 2001 demonstrating the use of
* DLLs as a substitute to the Inet - but Inet can do a good job!
if state=12 OR [SUCCESS]$upper(someotherstring)
   * Note I had to refer to an outside string OR the state
   * to flush it - it's been so long - I will try and remember!
   if LastCommand=somerequest
      vtData=this.getchunk(1024,0)
      strData=""
      do while .t.
      strData=strData+vtData
      vtData=this.getchunk(1024,0)
      if len(vtData)<1
         exit
      Endif
      Enddo
   endif
endif && Finished
>I wonder anyone could share some experience of using this ActiveX control in VFP. I'm trying to use this for http connection. I have a few questions.
>
>1. stateChanged. In VFP, I can only see one event - stateChanged. State 8 or 12 does not seem to always fire after I execute a Post and a response is ready. But sometimes state 8 (icResponseReceived) after I called getHeader(). When stateChange is supposed to be fired in VFP?
>
>2. hInternet. What is this property for? Initially it is set to 0. After a Post/Get, it is set to handle. However, after I cancel the request and connection, it still stays with that handle number. I am looking for a way to test to see whether the connection and request is there or not. How can I do that.
>
>3. Error. After I repeated Cancel and Post/Get, sometimes error could occur in Post/Get. How can I check to see when I can do a Post/Get?
Imagination is more important than knowledge
Previous
Reply
Map
View

Click here to load this message in the networking platform