How can you load a dll as an application? A "loader program does not sound 
like the same thing as a project exe to me. Perhaps you elaborate on that 
because what you've described sounds highly improper to me.

Dave

--- On Fri, 6/19/09, Paul Bennett <[email protected]> wrote:

From: Paul Bennett <[email protected]>
Subject: [delphi-en] Running Forms in DLLs
To: [email protected]
Date: Friday, June 19, 2009, 4:28 AM











    
            
            


      
      Hi all,



A little bit of background first...



I have a small application which basically consists of a MDI form 

which acts as host to a series of plugin forms. The application is 

relatively immature and subject to change. 



The application is only used at one site and all users have access to 

a shared directory on the network where the most up to date versions 

of the plugins are kept, this means it is relatively easy to check 

that the application always has the latest versions of the plugins.



Recently I have suffered from a bit of 'project creep', and I was 

looking at a way of applying the same system of updating the 

applications main form.



The Problem...



I decided to move all of the MDI Form (ie pretty much the whole 

application) into a dll, create a Loader program which checks the 

(local) dll version number against the (network) dll and downloads it 

as necessary and then loads the dll and opens the form.



This all seems to work fine, except... when the MDI form is closed 

the application crashes with an unknown exception. 



I've checked the MDI Form and as far as I can tell every object that 

is created as the form loads is freed and it unloads.



The following is the Code for the Library Project.



library FEBAPI;



uses

  ShareMem,

  madExcept,

  madLinkDisAsm,

  Forms,

  Dialogs,

  MainUI in 'Source\MainUI. pas' {FrameworkUI} ;



{$R *.res}



procedure RunFEB; stdcall;

var

  FrameworkUI: TFrameworkUI;

begin

  FrameworkUI := TFrameworkUI. Create(nil) ;

  FrameworkUI. ShowModal;

  FrameworkUI. Release;

end;



exports RunFEB;



begin

end.



When stepping through the RunFEB method, after FrameworkUI. Release is 

called, there are repeated calls to stdWinProc (around 5 at last 

count) until the Application crashes with an unknown exception.



Any pointers most gratefully received.



Paul Bennett




 

      

    
    
        
         
        
        








        


        
        


      

[Non-text portions of this message have been removed]

Reply via email to