Re: Interface function and TPersistent



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



.



Relevant Pages

  • [NEWS] Advanced Application-Level OS Fingerprinting: Practical Approaches and Examples
    ... Get your security news from a reliable source. ... Dan presents an alternate approach to application-level OS fingerprinting. ... cross-platform applications which result in OS-dependant responses. ... As a part of a default Apache ...
    (Securiteam)
  • Re: Active Directory/HIPPA Question
    ... The client ... > roll out AD when their top priority this year is securing the applications ... Security is one of the biggest reasons. ... ESPECIALLY if you have 800 remote offices. ...
    (microsoft.public.win2000.general)
  • RE: New Whitepaper - "Second-order Code Injection Attacks"
    ... I make no claims that this a previously "undiscovered" security flaw. ... code injection into web applications. ... differentiate between the code injection attacks - and to explain their ...
    (Bugtraq)
  • Re: Testing MS Security Patches?
    ... >implementing MS security updates on production systems. ... be to test those applications on which your business depends. ... Download the patch. ...
    (microsoft.public.security)
  • Re: Disadvantages of Dependency Inversion?
    ... outside of device-driver-like applications. ... by subsystem B, and specifically, directly invokes ... but instead on the interface I; and we have introduced a newdependency ... implement the POSIX interface. ...
    (comp.object)