Здравствуйте господа разработчики Опять компонента TMapObj. При инициализации в конструкторе , в предке TMapObj создаётся объект болванка
Код
TMapObjAcces = class(TMapComponent)
public
FObj:HObj;
constructor Create(AOwner:TComponent); override;
destructor Destroy; override;
end;
//++++++++++++++++++++++++++++++++++++++++++++++++++++
//++++++++++++++++++++++++++++++++++++++++++++++++++++
implementation
constructor TMapObjAcces.Create;
begin
inherited Create(AOwner);
FObj:=0;
end;
destructor TMapObjAcces.Destroy;
begin
if FObj <> 0 then mapFreeObject(FObj);
FObj := 0;
inherited Destroy;
end;
При использовании функций создания объекта типа function TMapObj.CreateObjectByInCode(Site ,Kind, InCode : integer) : integer; function TMapObj.CreateObjectByExcode(Site ,Kind, ExCode, Local : integer) : integer; function TMapObj.CreateObjectByKey(Site ,Kind : integer; akeyName : string) : integer;
Ни в одной из них не обрнаружил mapFreeObject. Вопрос Освобождается ли объект
function TMapObj.CreateObjectByInCode(Site ,Kind, InCode : integer) : integer; var siteh : HSITE; iCod : integer; mv : TMapViewWindow; begin mv := TMapViewWindow(GetMapViewWindow); Result := 0; iCod := 0; FreeCurrentObj; FOldFrame:=true; if not ((mv <> nil) and (mv.FMap <> 0)) then exit; if Site<>0 then begin siteh := mapGetSiteIdent(mv.FMap,Site); FObj := mapCreateSiteObject(mv.FMap,siteh,Kind,0) end else FObj := mapCreateObject(mv.FMap,1,Kind,0); if FObj<>0 then iCod := mapDescribeObject(FObj,InCode); if Assigned(FOnCreateNullObj) then FOnCreateNullObj(Self); if Assigned(FOnChangeObj) then FOnChangeObj(Self); if iCod <> 0 then Result := FObj; end;
Надо установить StyleSelect - способ выделения объекта карты в SEL_USERFUNC: устанавливает пользовательский тип выделения, который целиком определяется параметрами Image, Mode, Parm. Эти параметры должны быть заполнены заранее.