Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2003.02.24;
Скачать: CL | DM;

Вниз

Не могу вернуть параметры из метода интерфейса   Найти похожие ветки 

 
MV-GROB ©   (2003-02-08 13:45) [0]

Функция фозвращается а параметры возвращают пустое значение
вот код
unit SamAd;

{$WARN SYMBOL_PLATFORM OFF}

interface

uses
ComObj, SysUtils, ActiveX, AxCtrls, Classes, SampAd_TLB, StdVcl, Messages,Forms, Dialogs, FormSa,frm2;

type
TAddInSam = class(TAutoObject, IConnectionPointContainer, IAddInSam)
private
{ Private declarations }
FConnectionPoints: TConnectionPoints;
FConnectionPoint: TConnectionPoint;
FEvents: IAddInSamEvents;
{ note: FEvents maintains a *single* event sink. For access to more
than one event sink, use FConnectionPoint.SinkList, and iterate
through the list of sinks. }
public
procedure Initialize; override;
protected
{ Protected declarations }
property ConnectionPoints: TConnectionPoints read FConnectionPoints
implements IConnectionPointContainer;
procedure EventSinkChanged(const EventSink: IUnknown); override;
function ShowStr(Param1: Integer): HResult; stdcall;
function StrShow(var Param2: OleVariant): Integer; stdcall;
function DvaChisla(var per1, per2, kolzn, kolznpz: OleVariant): Integer;
stdcall;
end;


implementation

uses ComServ;

procedure TAddInSam.EventSinkChanged(const EventSink: IUnknown);
begin
FEvents := EventSink as IAddInSamEvents;
end;

procedure TAddInSam.Initialize;
begin
inherited Initialize;
FConnectionPoints := TConnectionPoints.Create(Self);
if AutoFactory.EventTypeInfo <> nil then
FConnectionPoint := FConnectionPoints.CreateConnectionPoint(
AutoFactory.EventIID, ckSingle, EventConnect)
else FConnectionPoint := nil;
end;


function TAddInSam.ShowStr(Param1: Integer): HResult;
begin
Param1:=Param1+1;
ShowMessage(IntToStr(Param1));
end;


function TAddInSam.StrShow(var Param2: OleVariant): Integer;
begin

Form2 := TForm2.Create(Application);
Form2.Edit1.Text:=IntToStr(Param2);
form2.ShowModal;
StrShow:=StrToInt(Form2.Edit1.Text);
end;

function TAddInSam.DvaChisla(var per1, per2, kolzn,
kolznpz: OleVariant): Integer;
begin
per1:=123;

//per2:=11;
DvaChisla:=per1;
end;

initialization
TAutoObjectFactory.Create(ComServer, TAddInSam, Class_AddInSam,
ciMultiInstance, tmApartment);
end.


методы вызываю из 1С пл=СоздатьОбъект("SampAd.AddInSam"); пл.DvaChisla(пар1,Пар2,пар3,пар4); Сообщить(пар1); и возвращается пустое значение


 
Romkin ©   (2003-02-13 15:39) [1]

Дай описание на IDL интерфейса iAddInSam и не советую пользовать русские буквы в названиях параметров



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

Текущий архив: 2003.02.24;
Скачать: CL | DM;

Наверх




Память: 0.47 MB
Время: 0.013 c
1-75969
Ag2002
2003-02-10 17:21
2003.02.24
Свернуть всё


3-75754
alextov
2003-02-05 16:33
2003.02.24
Что делать с lookup-полями в TQuery?


3-75766
KIR
2003-01-30 21:17
2003.02.24
Говорят, что IB плохо работает с деревьями...?


1-75930
OGR
2003-02-14 17:25
2003.02.24
Парсинг HTML файла


4-76241
mate
2003-01-10 16:31
2003.02.24
E-mail