How to send network messages

  • Thread starter Thread starter Jan B.
  • Start date Start date
J

Jan B.

Hi,

i'm searching a way how to send a message through
the messenger service. i found the corresponding
function in the "netapi32.dll". Now i got problems
while i try to use it.

Can anybody help me and say me how to do it or another
way to realize this feature?

Thx
Jan
(ps: i'm using vb .net 2002)
 
The API is NetMessasgeBufferSender, and should be declared like this:

(Replace <Scope> with Public/Private/Friend)

<WatchForWrapping>

<Scope> Declare Function NetMessageBufferSend Lib "NETAPI32.DLL" (ByVal
strServer As String, ByVal strTitle As String, ByVal strFrom As String,
ByVal strBuf As String, ByVal intLength As Integer) As Integer

</WatchForWrapping>

Then can be called like this:

Dim strMsg As String = "This is a network message"
NetMessageBufferSend("Server", "SendToComputer", "SentFromComputer", strMsg,
strMsg.Length)

--
HTH,
-- Tom Spink, Über Geek

Please respond to the newsgroup,
so all can benefit
 
Hi,

i tried it like you said but all thats coming back is
errostatus 123. is it the format used? Do i have to use
"\\" in front of the names?

Thx
Jan
-----Original Message-----
The API is NetMessasgeBufferSender, and should be declared like this:

(Replace <Scope> with Public/Private/Friend)

<WatchForWrapping>

<Scope> Declare Function NetMessageBufferSend Lib "NETAPI32.DLL" (ByVal
strServer As String, ByVal strTitle As String, ByVal strFrom As String,
ByVal strBuf As String, ByVal intLength As Integer) As Integer

</WatchForWrapping>

Then can be called like this:

Dim strMsg As String = "This is a network message"
NetMessageBufferSend
("Server", "SendToComputer", "SentFromComputer", strMsg,
 
Error 123 is ERROR_INVALID_NAME, so yes, it may be because the \\ are
required, or you have accidentally misspelt a computer name.

--
HTH,
-- Tom Spink, Über Geek

Please respond to the newsgroup,
so all can benefit


Hi,

i tried it like you said but all thats coming back is
errostatus 123. is it the format used? Do i have to use
"\\" in front of the names?

Thx
Jan
-----Original Message-----
The API is NetMessasgeBufferSender, and should be declared like this:

(Replace <Scope> with Public/Private/Friend)

<WatchForWrapping>

<Scope> Declare Function NetMessageBufferSend Lib "NETAPI32.DLL" (ByVal
strServer As String, ByVal strTitle As String, ByVal strFrom As String,
ByVal strBuf As String, ByVal intLength As Integer) As Integer

</WatchForWrapping>

Then can be called like this:

Dim strMsg As String = "This is a network message"
NetMessageBufferSend
("Server", "SendToComputer", "SentFromComputer", strMsg,
 
Hi,

i tried nearly all types of names and used all possible
configurations. So i think theres another problem than
only the wrong name. i can use the name when i try it with
net send ... So i don't know.....

Ciao, Thx
Jan
 
Hi ,

thanks for your tip. Right now i use the shell command like
you told me. but since the program might run on machines
where the net command has been removed i wanted to use
some other method.
Your mailslot info is quite interesting but i need to
address the users instead of the machine.

Thx
Jan
 
That is no topic for this newsgroup, to run a VB.net language application
you need to have installed the net framework on the computer running it.
 
@first: Hello,

for sure i got the framwork installed. i don't understand
why youre saying this is the wrong newsgroup since
i asked how to send a network message for the messenger
service out of a vb .net app.

feel free to explain yourself.

Jan
 
Back
Top