Re: Interface function and TPersistent
- From: "Mucker" <someone@xxxxxxxxxxxxx>
- Date: Wed, 21 Feb 2007 09:56:36 -0000
Hi Marc
What exactly are you trying to do?
We currently have a monolithic CRM/Sales/Purchase/Stock/Accounts etctetc
application that compiles down to a single executable. This is bad - it now
stands at over 200mb and consists of over 3000 forms and 5000 units.
I've finally persuaded my MD to allow me time to modularise the applicaton,
splitting it down into separate exe's but with the intention of having these
applications communicate and cooperate with each other as if a single
application was still running. Hopefully, the user will be none the wiser
that all these different applications are running - they will still be
working within an MDI application, having multiple windows open etc.
I have several system objects running within the current application
controlling such things as login and security. Security is class based -
i.e. when the user tries to open a form, a check is made to see if they can
actually open a form of the required class and what they can do within it
once it is open. The check is roughly like
AFormClass := TMyForm;
CanOpen := SecurityManager.CanOpen[AFormClass]
If the application is to be divided across multiple smaller applications,
each one of these needs access to this global object. This will be
implemented as an out of process server. What I thought I could do was to
replace the lines of code below with the following:
AFormClass := TMyForm;
SecurityManager := CoSecurityManager.Create;
CanOpen := SecurityManager.CanOpen(AFormClass)
Then, I would have liked to have another ComObject actually create the form
of the required class such as :
if Canopen then
begin
FormCreator := CoFormCreator.Create;
RequestedForm := FormCreator.CreateForm(TMyForm); // Is this
even possible - an interface creating and returning a form ????
FormCreator := nil;
end;
This would have been perfect. I intend to keep the forms in various BPL's
(as opposed to compiled into the EXE). This would have made version control,
client upgrading far simplier if I can just issue a new "accounts" library
(BPL), rather than a 200mg executable. It also means that developers working
on different modules can work within reason, independent of each other.
Currently, when a new version is created all development work stops. These
not need be the case in the new senario.
In implementing the above Security method, I do not need to change any forms
(there are over 3000 of the buggers). Now it looks like I will have to
create an interface for each and every one and pass this through and have
the security check made upon Interface rather than Class.
It doesn't help that I have strict deadlines lines on this.
regards
Steve
"Marc Rohloff" <marcrohloff_ng@xxxxxxxxxxx> wrote in message
news:1171980368.188756.8530@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Feb 16, 12:37 pm, "Steve" <s...@xxxxxxxxxxxxx> wrote:
I need to pass a parameter to an interface function that is of type
TPersistent.
Can anyone tell me what equivalent parameter type this would take in the
type library editor?
You cannot pass objects through a COM interface, COM does not know how
to move abjects between processes. You need to define an interface
with the functions that you need and have your classes implement it.
What exactly are you trying to do?
--
Marc
.
- Follow-Ups:
- Re: Interface function and TPersistent
- From: Marc Rohloff
- Re: Interface function and TPersistent
- References:
- Interface function and TPersistent
- From: Steve
- Re: Interface function and TPersistent
- From: Marc Rohloff
- Interface function and TPersistent
- Prev by Date: Re: Q: Cannot control vista api "SHGetKnownFolderPath" using shell32.dll in Delphi 7 on Windows XP.
- Next by Date: Re: Interface function and TPersistent
- Previous by thread: Re: Interface function and TPersistent
- Next by thread: Re: Interface function and TPersistent
- Index(es):
Relevant Pages
|