Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
NetApi32.DLL and Net Send Function
Message
 
To
01/09/1999 10:01:58
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00260111
Message ID:
00260169
Views:
14
>>>I am Looking for a way to do a NET SEND from VFP6.0 with out having a Command Window Flash on the Screen. I have found that the NetApi32.DLL has some Functions in it to do such a thing (I Think).
>>>Does Anybody know how and what i need to do?
>>>
>>>** My COde
>>>DECLARE INTEGER NetMessageBufferSend in netAPI32;
>>>STRING @LPWSTR, STRING @LPWSTR, ;
>>>STRING @LPWSTR , STRING @LPBYTE
>>>
>>>lnresult = NetMessageBufferSend('','SOMEPC',"MTPC","TEST MESSAGE")
>>>
>>>Thanks,
>>
>>Hi Bob,
>>
>>The declaration should be:
>>DECLARE INTEGER NetMessageBufferSend IN NetAPI32;
>> STRING @servername, STRING @msgname,;
>> STRING @fromname, STRING @buf, INTEGER buflen
>>The first three parameters need to be UNICODE strings. The fourth does not. The fifth is the length of the message in the fourth parameter.
>>
>>Not being an NT user, I don't think that I can be of more help in this area, however.
>
>
>Thanks George, Please forgive me for being an amature at this but, What is a UNICODE String?

No need to ask for forgiveness. A UNICODE string is like a normal character string except that each character is represented by two bytes instead of one. The following is a short function that converts an American ASCII string to UNICODE:
FUNCTION ToUNICODE

  LPARAMETER pcstring
  
  LOCAL lcresult, lczero, lni, lnlast
  lczero = CHR(0)
  lnlast = LEN(pcstring)
  lcresult = ""
  FOR lni = 1 TO lnlast
    lcresult = lcresult + SUBSTR(pcstring, lni, 1) + lczero
  NEXT
  RETURN lcresult
ENDFUNC
George

Ubi caritas et amor, deus ibi est
Previous
Reply
Map
View

Click here to load this message in the networking platform