I'm attempting to make a VB function for NetMessageBufferSend in netapi32.dll. So far, I've come up with:

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

From the API doc's it is:

NET_API_STATUS NetMessageBufferSend(
LPWSTR servername,
LPWSTR msgname,
LPWSTR fromname,
LPBYTE buf,
DWORD buflen
);

Everytime I call the function though it returns an error 53 - which from doc's that I've been able to find is "Network path not found". I think it has something to do with the Unicode translations and all. Does anyone have a VB function for this API before I spend the next 4 hours playing around with it?

Thanks!