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

Вниз

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

 
MV-GROB ©   (2003-02-07 17:09) [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.


 
MV-GROB ©   (2003-02-07 17:12) [1]

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


 
Юрий Федоров ©   (2003-02-07 17:58) [2]

так оно же не инициализируется в методе TAddInSam.DvaChisla !
(ну и название, однако !). Что пришло, то и вернулось


 
MV-GROB ©   (2003-02-07 18:03) [3]

Юрий Федоров
что значит не инициализируется ?


 
Юрий Федоров ©   (2003-02-07 19:32) [4]

пар1 внутри DvaChisla не меняется. А ты его "Сообщить(пар1)"



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

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

Наверх




Память: 0.47 MB
Время: 0.021 c
6-53135
cybermonk
2002-12-23 16:31
2003.02.17
SendArp


14-53198
Мусорщик
2002-11-24 15:09
2003.02.17
Расскажи подробнее о www.combats.ru


3-52757
LazorenkoX
2003-01-30 14:10
2003.02.17
AfterScroll


1-52934
NetKnight
2003-02-05 09:37
2003.02.17
Shortcuts


1-53008
v2a
2003-02-10 17:17
2003.02.17
Отладка сервисов.