Hi,
I'm just beginning with PB/DLL, so it could be sthing obvious, but I'm at a total loss: I'd like to use the NetMessageBufferSend API to perform the equivalent of DOS' net send, ie. send a message to a host.
Declare FUNCTION NetMessageBufferSend LIB "NETAPI32.DLL" ALIAS "NetMessageBufferSend" (server AS ASCIIZ, receiver AS ASCIIZ, sender AS ASCIIZ, msg AS ASCIIZ, BYVAL msglen AS LONG) AS LONG
LOCAL sServer AS ASCIIZ * 64
LOCAL sTo AS ASCIIZ * 64
LOCAL sFrom AS ASCIIZ * 64
LOCAL lpBuffer AS ASCIIZ * 255
LOCAL slength As Long
LOCAL lResult AS LONG
sServer = ""
sTo = "W2K"
sFrom = "W2K"
lpBuffer ="Test"
sLength = Len(lpBuffer)
lResult = NetMessageBufferSend (sServer, sTo, sFrom, lpBuffer, sLength)
<B>=> "User or workstation was not found"</B>
FYI, net send w2k "This is a test" works. Both the Msg Browser and Computer Browser services run.
1. Could it be a Unicode issue?
2. What's the difference between the first two parameters (server on which the function will run, name to which the msg will be sent)?
Thx much for any tip
FF.
------------------
I'm just beginning with PB/DLL, so it could be sthing obvious, but I'm at a total loss: I'd like to use the NetMessageBufferSend API to perform the equivalent of DOS' net send, ie. send a message to a host.
Declare FUNCTION NetMessageBufferSend LIB "NETAPI32.DLL" ALIAS "NetMessageBufferSend" (server AS ASCIIZ, receiver AS ASCIIZ, sender AS ASCIIZ, msg AS ASCIIZ, BYVAL msglen AS LONG) AS LONG
LOCAL sServer AS ASCIIZ * 64
LOCAL sTo AS ASCIIZ * 64
LOCAL sFrom AS ASCIIZ * 64
LOCAL lpBuffer AS ASCIIZ * 255
LOCAL slength As Long
LOCAL lResult AS LONG
sServer = ""
sTo = "W2K"
sFrom = "W2K"
lpBuffer ="Test"
sLength = Len(lpBuffer)
lResult = NetMessageBufferSend (sServer, sTo, sFrom, lpBuffer, sLength)
<B>=> "User or workstation was not found"</B>
FYI, net send w2k "This is a test" works. Both the Msg Browser and Computer Browser services run.
1. Could it be a Unicode issue?
2. What's the difference between the first two parameters (server on which the function will run, name to which the msg will be sent)?
Thx much for any tip
FF.
------------------
Comment