精华区 [关闭][返回]

当前位置:网易精华区>>讨论区精华>>编程开发>>● Delphi>>Delphi 网络编程>>浏览器>>终于找到如何使ActiveForm获取网页中参数的方法了!!!

主题:终于找到如何使ActiveForm获取网页中参数的方法了!!!
发信人: jeketl@GZ()
整理人: teleme(2001-02-25 22:48:09), 站内信件

标  题: 终于找到如何使ActiveForm获取网页中参数的方法了!!!
发信站: 网易虚拟社区 (Thu Jul 20 20:55:22 2000), 站内信件

我在Borland新闻组中找到如何使ActiveForm获取网页中参数的方法:

Hmmm.  I followed an example from one of these newsgroups and got it w
orking
without a hitch.  Did you declare support for IPersistPropertyBag in t
he
class definition?

Here is what mine looks like, with non-essentials removed:

class  TMyActiveForm = class(TActiveForm, IMyActiveForm,
IPersistPropertyBag)

protected:
// IPersistPropertyBag
    function IPersistPropertyBag.GetClassID = PersistPropertyBagGetCla
ssID;
    function IPersistPropertyBag.InitNew = PersistPropertyBagInitNew;

    function IPersistPropertyBag.Load = PersistPropertyBagLoad;
    function IPersistPropertyBag.Save = PersistPropertyBagSave;
    function PersistPropertyBagInitNew: HResult; stdcall;
    function PersistPropertyBagGetClassID(out classID: TCLSID): HResul
t;
stdcall;
    function PersistPropertyBagLoad(const pPropBag: IPropertyBag; cons
t
pErrorLog: IErrorLog): HResult; stdcall;
    function PersistPropertyBagSave(const pPropBag: IPropertyBag;
fClearDirty: BOOL; fSaveAllProperties: BOOL): HResult; stdcall;
end;

implementation

(*
* IPersistPropertyBag
*)

function TMyActiveForm.PersistPropertyBagLoad(const pPropBag: IPropert
yBag;
const pErrorLog: IErrorLog): HResult;
var
  v : OleVariant;
begin
   if pPropBag.Read('ShowLegend', v, pErrorLog) = S_OK then
      Set_ShowLegend( v );
   if pPropBag.Read('XMLDSOID', v, pErrorLog) = S_OK then
      Set_XMLDSOID( v );

   result := S_OK;
end;

function TMyActiveForm..PersistPropertyBagSave(const pPropBag: IProper
tyBag;
fClearDirty, fSaveAllProperties: BOOL): HResult;
var
  v : OleVariant;
begin
   v := FShowLegend;
   pPropBag.Write( 'ShowLegend', v );
   v := FXMLDSOID;
   pPropBag.Write( 'XMLDSOID', v );

   result := S_OK;
end;

function TMyActiveForm..PersistPropertyBagGetClassID( out classID: TCL
SID):
HResult;
begin
   try
      classID := Class_MyActiveForm;
      Result := S_OK;
   except
   end;
end;

function TMyActiveForm.PersistPropertyBagInitNew: HResult;
begin
   try
      result := S_OK;
   except
   end;
end;



--
※ 来源:.月光软件站 http://www.moon-soft.com.[FROM: 61.142.129.24]

[关闭][返回]