BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

PLEASE!!! - Implementing Ipersistfile

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi ActiveX Controls Development
View previous topic :: View next topic  
Author Message
Tom Grills
Guest





PostPosted: Wed Oct 01, 2003 11:05 am    Post subject: PLEASE!!! - Implementing Ipersistfile Reply with quote



I have an automation object that I want to have implement IpersistFile.
I've got to a certain point (see clip below) and I'm at a loss as to what to
actually put into the methods I have to implement. Could someone give me an
example of an implementation that I might use as a reference for mine or any
documents that may explain it better?

======== Code STARTS Here =======

TPersistObj = class(TAutoObject, IPersistObj, IPersistFile)
private
{ Private declarations }
protected
{ Protected declarations }
{ PERSISTENCE FUNCTIONS }
function IPersistfile.GetCurFile = PersistFileGetCurFile;
function IPersistfile.IsDirty = PersistFileIsDirty;
function IPersistfile.Load = PersistFileLoad;
function IPersistfile.Save = PersistFileSave;
function IPersistfile.GetClassID = PersistFileGetClassId;
function IPersistfile.SaveCompleted = PersistFileSaveCompleted;

function PersistFileSaveCompleted(pszFileName: POleStr): HResult;
stdcall;
function PersistfileGetClassID(out classID: TCLSID): HResult; stdcall;
function PersistFileIsDirty: HResult; stdcall;
function PersistFileLoad(pszFileName: POleStr; dwMode: Longint):
HResult;
stdcall;
function PersistFileSave(pszFileName: POleStr; fRemember: BOOL):
HResult;
stdcall;
function PersistFileGetCurFile(out pszFileName: POleStr): HResult;
stdcall;
end;

implementation

uses ComServ;

function TPersistObj.PersistFileSaveCompleted(pszFileName: POleStr):
HResult;
stdcall;
begin

//******** What Do I do in Here????? *******

result:=S_OK; //<==== Returns OK till I know what to do here....
end;

function TPersistObj.PersistfileGetClassID(out classID: TCLSID): HResult;
stdcall;
begin

//******** What Do I do in Here????? *******

result:=S_OK; //<==== Returns OK till I know what to do here....
end;

function TPersistObj.PersistFileIsDirty: HResult; stdcall;
begin

//******** What Do I do in Here????? *******

result:=S_OK; //<==== Returns OK till I know what to do here....

end;

function TPersistObj.PersistFileLoad(pszFileName: POleStr; dwMode: Longint):
HResult;
stdcall;
begin

//******** What Do I do in Here????? *******

result:=S_OK; //<==== Returns OK till I know what to do here....

end;

function TPersistObj.PersistFileSave(pszFileName: POleStr; fRemember: BOOL):
HResult;
stdcall;
begin

//******** What Do I do in Here????? *******

result:=S_OK; //<==== Returns OK till I know what to do here....

end;

function TPersistObj.PersistFileGetCurFile(out pszFileName: POleStr):
HResult;
stdcall;
begin

//******** What Do I do in Here????? *******

result:=S_OK; //<==== Returns OK till I know what to do here....

end;


initialization
TAutoObjectFactory.Create(ComServer, TPersistObj, Class_PersistObj,
ciMultiInstance, tmApartment);
end.

================ CODE ENDS HERE ============================

Again, thanks in advance for suffering through what must be a real newbie
question......

Tom Grills




Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi ActiveX Controls Development All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.