Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
OLE Exception code using my class
Message
 
À
22/08/2007 14:05:16
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Divers
Thread ID:
01249645
Message ID:
01249676
Vues:
27
Jay,

I only used the Winsock control loooong time ago for something very simple (and just for testing) and now I do not remember anything, and I tried to find you a tutorial on it, but I did not find anything good. What I am sure is happening is that you oSock.State is not valid, I wish I could find what are the values, I think 7 means connected. Anyways, it is ok not to have code in DMSWinsockControlEvents_Connect() you need to think the IMPLEMENTS as hooks, methods that will fire each time an event of the control you are implementing fires, so, when in your code you did something like EVENTHANDLER(WinsockObject, this) what you are doing is binding each of the events of the control to some methods in your object, so, for example, when the Winsock fires the event 'Connect' the code in your method DMSWinsockControlEvents_Connect() of your class will fire too, and if you just want the default behaviour, it is ok to have it empty, what you can not do is remove the method, for when you said IMPLEMENTS you are bound to have all the methods defined. I am not sure if I explained it right, now I need to finish something, but as the next step I suggest you to check what the value of ox.oSock.State is right after you call connect. HTH

[Update]
Found this
state = 0 -> PortReset
state = 1 -> Open
state = 2 -> Listening
state = 7 -> Connected
state = 9 -> Error has occured
otherwise -> Disconnected

from http://www.foxite.com/archives/understanding-winsock-control-0000052660.htm


>I see that I don't have any code in this, but there isn't any in the visual OLE either. This is the confusing part for me. How do I know what the code is suppsed to be if I'm rewriting all these methods? What's the point of having the winsock control? Stupid questions I'm sure, but that's where I am.
>
>
>
>	**********************************************************
>	PROCEDURE DMSWinsockControlEvents_Connect() AS VOID HELPSTRING "Occurs connect operation is completed"
>		* add user code here
>
>		ENDPROC
>
>
>>Jay,
>>
>>You need to connect to the remote host first
>>
>>
>>ox.oSock.Connect([Remote Host], [Remote Port])
>>
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?

"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare

"To die for a religion is easier than to live it absolutely"
Jorge L. Borges
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform