Cakkie
February 21st, 2000, 05:14 AM
I'm using this code to send a message over the network. There is only one problem:
It only works if I try to send a message to myself, when I try to message another pc or user on the network, it does not work. All the PC's are running WINNT 4
private Declare Function NetMessageBufferSend Lib "netapi32.dll" (byval ServerName as string, byval MsgName as string, byval FromName as string, Buf as Any, BufLen as Long) as Long
private Sub sendNetMsg(byval strTo as string,byval strFrom as string, strMessage as string)
Dim sName as string
dim sMsg as string
dim sBuf as string
Dim lLen as long
dim ret as long
sNameFrom = StrConv(strFrom, vbUnicode)
sNameTo = StrConv(strTo, vbUnicode)
sMsg = StrConv(strFrom, vbUnicode)
sBuf = StrConv(strMessage, vbUnicode)
lLen = LenB(sBuf)
ret = NetMessageBufferSend(sNameTo, sMsg, sNameFrom, byval sBuf, byval lLen)
End Sub
Tom Cannaerts
slisse@planetinternet.be
The best way to escape a problem, is to solve it.
It only works if I try to send a message to myself, when I try to message another pc or user on the network, it does not work. All the PC's are running WINNT 4
private Declare Function NetMessageBufferSend Lib "netapi32.dll" (byval ServerName as string, byval MsgName as string, byval FromName as string, Buf as Any, BufLen as Long) as Long
private Sub sendNetMsg(byval strTo as string,byval strFrom as string, strMessage as string)
Dim sName as string
dim sMsg as string
dim sBuf as string
Dim lLen as long
dim ret as long
sNameFrom = StrConv(strFrom, vbUnicode)
sNameTo = StrConv(strTo, vbUnicode)
sMsg = StrConv(strFrom, vbUnicode)
sBuf = StrConv(strMessage, vbUnicode)
lLen = LenB(sBuf)
ret = NetMessageBufferSend(sNameTo, sMsg, sNameFrom, byval sBuf, byval lLen)
End Sub
Tom Cannaerts
slisse@planetinternet.be
The best way to escape a problem, is to solve it.