public
{ Public declarations }
end;
var
DllHandle : HMODULE;
GetFIOPadeg : function (pLastName, pFirstName, pMiddleName: PChar;
bSex: Boolean; nPadeg: LongInt; pResult: PChar;
var nLen: LongInt): Integer; stdcall;
Form2: TForm2;
Sex:boolean;
nLen:LongInt;
pResult:PChar;
pVar:integer;
FPadeg:Boolean;
Fio,nName,SName:string;
implementation
procedure TForm2.ComboBox2Chenge(Sender: TObject);
begin
Fio:=ComboBox2.Text;
Sex:=True;
if Assigned(GetFIOPadeg) then
begin
nLen := Length(FIO)+10;
pResult:=StrAlloc(nLen);
try
pVar:=GetFIOPadeg(PChar(Fio),'','',Sex,3, pResult, nLen);
Edit3.Text:=pResult;
finally
StrDispose(pResult);
end;
end;
end;procedure TForm12.ComboBox2Chenge(Sender: TObject);
begin
Fio:=ComboBox2.Text;
Sex:=True;
if Assigned(GetFIOPadeg) then
begin
nLen := Length(FIO)+10;
pResult:=StrAlloc(nLen);
try
pVar:=GetFIOPadeg(PChar(Fio),'','',Sex,3, pResult, nLen);
Edit3.Text:=pResult;
finally
StrDispose(pResult);
end;
end;
end;
initialization
DllHandle := LoadLibrary('padeg.dll');
FPadeg:=True;
if DllHandle <> 0 then
Begin
@GetFIOPadeg := GetProcAddress(DllHandle, 'GetFIOPadeg');
end
else
FPadeg:=False;
finalization
FreeLibrary(DllHandle);
end.
procedure TForm1.ComboBox1Chenge(Sender: TObject);
begin
F:=LeftStr(ComboBox1.Text, PosEx(' ',ComboBox1.Text));
io:=RightStr(ComboBox1.Text, PosEx(' ', ComboBox1.Text));
Sex:=True;
if Assigned(GetFIOPadeg) then
begin
nLen := Length(F)+10;
pResult:=StrAlloc(nLen);
try
pVar:=GetFIOPadeg(PChar(F),'','',Sex,3, pResult, nLen);
Edit1.Text:=pResult+io;
finally
StrDispose(pResult);
end;
end;
end;
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Menus, INIFiles, StdCtrls, StrUtils;
......
......
......
Fio, F, io,nName,SName:string;
......
......
......
procedure TForm1.ComboBox1Chenge(Sender: TObject);
begin
Fio:=ComboBox1.Text;
F:=LeftStr(Fio, PosEx(' ', Fio));
io:=RightStr(Fio, Length(Fio)-PosEx(' ', Fio));
Sex:=True;
if Assigned(GetFIOPadeg) then
begin
nLen := Length(F)+10;
pResult:=StrAlloc(nLen);
try
pVar:=GetFIOPadeg(PChar(F),'','',Sex,3, pResult, nLen);
Edit1.Text:=pResult+' '+ io;
finally
StrDispose(pResult);
end;
end;
end;
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Menus, INIFiles, StdCtrls, StrUtils;
......
......
......
Fio, F, io, nName,SName:string;
......
......
......
procedure TForm1.ComboBox1Chenge(Sender: TObject);
begin
Fio:=ComboBox1.Text;
F:=LeftStr(Fio, PosEx(' ', Fio));
io:=RightStr(Fio, Length(Fio)-PosEx(' ', Fio));
Sex:=True; //если поменять здесь т.е. использовать какой нибудь еще ComboBox - то будут склоняться женские фамилии при Sex:=False;
if Assigned(GetFIOPadeg) then
begin
nLen := Length(F)+10;
pResult:=StrAlloc(nLen);
try
pVar:=GetFIOPadeg(PChar(F),'','',Sex,3, pResult, nLen);
Edit1.Text:=pResult+' '+ io;
finally
StrDispose(pResult);
end;
end;
end;
Если Вы уже зарегистрированы на Портале - войдите в систему, если Вы еще не регистрировались - пройдите простую процедуру регистрации.