Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is it impossible to use sendto in VB?

Status
Not open for further replies.

TJNweb

Programmer
Dec 9, 2002
50
0
0
EE
Hello, I have question aboute sendto function with Socket.
in msdn:

########################################################
int sendto(
SOCKET s,
const char* buf,
int len,
int flags,
const struct sockaddr* to,
int tolen
);

s
[in] Descriptor identifying a (possibly connected) socket.
buf
[in] Buffer containing the data to be transmitted.
len
[in] Length of the data in buf, in bytes.
flags
[in] Indicator specifying the way in which the call is made.
to
[in] Optional pointer to a SOCKADDR structure that contains the address of the target socket.
tolen
[in] Size of the address in to, in bytes.

#########################################################

But parameter to [in] is user defined structure and it should be passed byVal (pointer), but VisualBasic 5.0 can't do it. (Pass user difened structured byVal).
It is very involved situation and I will be grateful to everybody who can help me. Actually I want to send broadcast message

Thanks in advance
tjn.web@mail.ee

 
ByVal is NOT passing a pointer, ByVal is passing a copy.
ByRef is passing a pointer.
Greetings,
Rick
 
Thanks LazyMe,
Do you have any example how to send data by using sendto?
 
No, I'm sorry but I've never used them socket APIs.
Greetings,
Rick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top