Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "Сети";
Текущий архив: 2004.11.14;
Скачать: [xml.tar.bz2];

Вниз

Netsend от другово имени.   Найти похожие ветки 

 
BLABLA   (2004-09-07 08:44) [0]

Как реализовать net send от другово имени.
Спасибо всем


 
Rouse_ ©   (2004-09-07 09:18) [1]

NetMessageBufferSend, третий параметр слева (или справа :)


 
MetalFan ©   (2004-09-07 12:19) [2]

хе-хе... не прокатит!
вот как делаю я:
function NetSend_Messenger(Source,Dest, Msg: String): boolean; type
 TNetMessageBufferSendFunction = function(servername, msgname, fromname: PWideChar;
   buf: PWideChar; buflen: Cardinal): Longint; stdcall;
 TNetNameFunction = function(servername, msgname: PWideChar): Longint; stdcall;

var
 NetMessageBufferSend: TNetMessageBufferSendFunction;
 SourceWideChar: WideString;
 DestWideChar: WideString;
 MessagetextWideChar: WideString;
function NameAdd(aName:string):boolean;
var
   lWS2: WideString;
   lProc:TNetNameFunction;
begin
   lWS2:=aName;
   @lProc := GetProcAddress(FLibHandle, "NetMessageNameAdd");
   if @lProc = nil then
   begin
     Result := false;
     Exit;
   end;
   result:= lProc(nil,PWideChar(lWS2))=0;
end;
function NameDel(aName:string):boolean;
var
 lWS2: WideString;
  lProc:TNetNameFunction;
begin
   lWS2:=aName;
   @lProc := GetProcAddress(FLibHandle, "NetMessageNameDel");
   if @lProc = nil then
   begin
     Result := false;
     Exit;
   end;
   result:= lProc(nil,PWideChar(lWS2))=0;
end;
begin
 @NetMessageBufferSend := GetProcAddress(FLibHandle, "NetMessageBufferSend");
 if @NetMessageBufferSend = nil then
 begin
   Result := false;
   Exit;
 end;
     if length(source)>0 then
       if not NameAdd(Source) then exit;
     SourceWideChar:=Source;
     MessagetextWideChar:=Msg;
     DestWideChar:=Dest;
     if length(Source)>0 then
       Result := NetMessageBufferSend(nil, PWideChar(DestWideChar), PWideChar(SourceWideChar),
           PWideChar(MessagetextWideChar), Length(MessagetextWideChar) * 2)=0
     else
       Result := NetMessageBufferSend(nil, PWideChar(DestWideChar), nil,
           PWideChar(MessagetextWideChar), Length(MessagetextWideChar) * 2)=0;

     NameDel(Source);
end;


 
Сетевик   (2004-09-07 13:28) [3]

Народ, подскажите, а для чего нужет первый параметр в NetMessageBufferSend ?


 
MetalFan ©   (2004-09-07 15:41) [4]

...
Parameters:
servername
[in] Pointer to a constant Unicode string specifying the name of the remote server on which the function is to execute. The string must begin with \\. If this parameter is NULL, the local computer is used.
...

теперь понятно?



Страницы: 1 вся ветка

Форум: "Сети";
Текущий архив: 2004.11.14;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.45 MB
Время: 0.106 c
14-1099036914
Baks
2004-10-29 12:01
2004.11.14
Мастера подскажите, помогите чайнику...


3-1097930940
TSL
2004-10-16 16:49
2004.11.14
Проблема с полем Image в mssql2000


3-1098085500
Ega23
2004-10-18 11:45
2004.11.14
В чём может быть дело???


6-1094129018
GuAV
2004-09-02 16:43
2004.11.14
TEmbeddedWb


1-1098909707
Garfunkel
2004-10-28 00:41
2004.11.14
Название загруженного в TImage изображения





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский