Mike
this might work:
LOCAL loSocket, loInterface, lcData
loSocket = CREATEBOBJECT('yoursocketactivex')
loInterface = GETINTERFACE(m.loSocket, 'ISomeInterface') && replace
ISomeInterface with the real interface name that contains the method you
want to call (lookup in Object Browser)
lcData = CREATEBINARY(yourData)
loInterface.TheMethod(lcData)
Regards
Christian
I would think VFP would have some way of accomplishing this.
Any ideas?
Thanks,
Mike
"Christian Ehlscheid" <c.ehl...@edv-ermtraud.de> wrote in message
news:u$QmaxBmK...@TK2MSFTNGP06.phx.gbl...
VFP actually does pass a safearray of type VT_UI1 when you pass a string
created with CREATEBINARY.
You could try to use the COMARRAY function ...
LOCAL loSocket, loInterface, lcData
loSocket = CREATEBOBJECT('yoursocketactivex')
COMARRAY(m.loSocket, 1000) && try a few combinations of parameter 2
lcData = CREATEBINARY(yourData)
...
For locating the interface in the object browser just select your DLL,
expand the "Interfaces" node on the left pane, select an interface and
expand the "Methods" node on the right pane, if your method is listed there
you've probably got the right interface (if there aren't interfaces which
contain equal methods).
Regards
Christian
Thanks,
Mike
"Christian Ehlscheid" <c.ehl...@edv-ermtraud.de> wrote in message
news:uIvYgEem...@TK2MSFTNGP04.phx.gbl...
Thanks,
Mike
"MikeA" <app...@appellsoftware.com> wrote in message
news:e1CdRFlm...@TK2MSFTNGP04.phx.gbl...
can you tell me the name of the ActiveX control your're evaluating?
Without having a look myself at the control I can only guess on the correct
setting or if it's possible at all.
Regards
Christian
Mike
"Christian Ehlscheid" <c.ehl...@edv-ermtraud.de> wrote in message
news:uJnadAom...@TK2MSFTNGP02.phx.gbl...
i've uploaded a working sample using the Microsoft Winsock Control @
http://vfp2c.dyndns.org/uploads/files/winsocktest.zip
> What is perplexing to me is this: If I transfer from workstation to
> server and I transfer File1 to File2 then they do not compare but if I do
> it a second time and transfer File1 to File3 then they still do not
> compare and surprisingly File2 and File3 do not compare either. This is
> most surprising because it's almost as if there is a "randomness" in the
> data being sent.
I've encountered the same problem. The problem is caused by
the event sequence of the DataArrival Event.
The _VFP.AutoYield property has to be set to .F. in the winsock server
application, otherwise VFP will ocassionally trigger the DataArrival Event
during the
processing of the DataArrival event itself.
This also explains why the data corruption is random.
Regards
Christian
Mike
"Christian Ehlscheid" <c.ehl...@edv-ermtraud.de> wrote in message
news:uuS2yiZn...@TK2MSFTNGP04.phx.gbl...
I've tested it with a ~700MB avi file, i'm sure it'll work with every other
file too.
Christian
Thanks,
Mike
"Christian Ehlscheid" <c.ehl...@edv-ermtraud.de> wrote in message
news:Ow9TqBan...@TK2MSFTNGP05.phx.gbl...
i've updated the sample @
http://vfp2c.dyndns.org/uploads/files/winsocktest.zip
now also contains vcx based winsock wrappers hosted in a form.
The one thing besides _VFP.AutoYield that is critical to receive binary
data is the code in the DataArrival Event of the server socket, one has
to call the GetData method of the winsock ocx like this:
#DEFINE vbArray 8192
#DEFINE vbByte 17
LOCAL lcData
lcData = '' && initialize to plain string
theSocket.GetData(@m.lcData, vbArray + vbByte)
Christian
1. I'm wondering if this will work equally well in VFP 6/sp3 because I
noticed some commands are not supported but I did test your code in VFP 9
and it works.
2. I'm wondering if it matters if I don't put the m.lcData and just lcData
as that should also assume memory variables (I'm just trying to figure out
why my code did not work.
3. (and most important) I'm trying to figure out how to do this with the
Mabry Socket control. Also, I tried it before with winsock and I was
getting corruptions with both the mabry socket as well as the winsock but
when I compare the winsock code (mine and yours) I'm quite certain I'll
figure it out for winsock. I just don't know why the mabry socket is not
working. I can't recall if I used the second parameter with GetData but
I'll check my archives on that.
I really appreciate all the help you are providing me on this.
Thanks,
Mike
"Christian Ehlscheid" <chri...@vfp2c.com> wrote in message
news:OWQOimen...@TK2MSFTNGP06.phx.gbl...
Thanks,
Mike
"MikeA" <app...@appellsoftware.com> wrote in message
news:u6bv8qin...@TK2MSFTNGP05.phx.gbl...
Thanks,
Mike
"MikeA" <app...@appellsoftware.com> wrote in message
news:%23pj6BWm...@TK2MSFTNGP02.phx.gbl...
I'm assuming theSocket is the winsock control, so you may want to try
theSocket.OBJECT.GetData(@m.lcData, vbArray + vbByte)
Using .OBJECT solves many problems when I use non-VFP controls. It may help
in VFP 6.
I suggest adding it to all calls to non-VFP methods of theSocket and
testing.
ED.
"MikeA" <app...@appellsoftware.com> wrote in message
news:%23uGDhZm...@TK2MSFTNGP05.phx.gbl...
Any ideas would be most appreciated.
Thanks,
Mike
"ED" <nos...@thankyou.com> wrote in message
news:exqM0lxn...@TK2MSFTNGP04.phx.gbl...
Thanks,
Mike
"MikeA" <app...@appellsoftware.com> wrote in message
news:uGTx2s3n...@TK2MSFTNGP04.phx.gbl...
> Any way to make this work in VFP 6/sp3? Why don't the sockets work?
seems like VFP6 SP3 doesn't handle COM marshaling of the safearray datatype
correctly.
My FLL @ http://vfp2c.dyndns.org has an undocumented function called
"IDispatch_Invoke" which is able to call a method on a COM object and do
customizable marshaling of parameters,
it's not 100% finished so i'll have to have a look at it and make it work
with parameters passed by reference.
If you're interested I will finish it, so it at least will work with the
GetData method of the MS Winsock control.
Regards
Christian
Mike
"Christian Ehlscheid" <c.ehl...@edv-ermtraud.de> wrote in message
news:uSEmwNCo...@TK2MSFTNGP04.phx.gbl...
No, i haven't used any other ActiveX socket controls besides the one
provided by Microsoft yet.
But if VFP 6/sp3 can't handle the safearray of byte datatype correctly
then you're out of luck since this is the only datatype in COM in general
which can transfer binary data safely.
Alternatively you can consider to use the winsock API directly, at least for
the server part.
A sample can be found here: http://www.news2news.com/vfp/?example=412
Regards
Christian
I'm wondering where the source is for your link and how I access samples to
test this.
Thanks again,
Mike
"Christian Ehlscheid" <c.ehl...@edv-ermtraud.de> wrote in message
news:OLfaK8No...@TK2MSFTNGP02.phx.gbl...
What are the DLLs that must be installed and registered for VFP9?
Thanks again for all the help,
Mike
"MikeA" <app...@appellsoftware.com> wrote in message
news:u1oz3IRo...@TK2MSFTNGP06.phx.gbl...