Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 560187
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T12:19:00+00:00 2026-05-13T12:19:00+00:00

i moved my project into a DLL and in there I declared a procedure

  • 0

i moved my project into a DLL and in there I declared a procedure like this

procedure StartApp;
var
   myForm : TmyForm;
begin
   myForm:=TmyForm.Create(Application);
   myForm.Show;
end;

exports StartApp;

my main application’s contains a dpr file containing:

procedure StartAPP; external 'myDLL.dll';

begin
   StartAPP;
end;

when i run my project it opens myForm and then it exits my application. Can anyone tell me what i have done wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T12:19:00+00:00Added an answer on May 13, 2026 at 12:19 pm

    Your procedure in the dLL is showing a non-modal form, in your caller application you do not have any code for message loop, if you look at a DPR file created by Delphi for a VCL form application, you will see a code similar to this:

    begin
      Application.Initialize;
      Application.MainFormOnTaskbar := True;
      Application.CreateForm(TForm1, Form1);
      Application.Run;
    end.
    

    This code initializes the application, creates the form, and then runs the message loop, and this message loop iterates and processes received messages until your application is terminated.

    In your code, you just did the form creation part, not the rest of it. You can have the above code in your own code and replace Application.CreateForm with your own form creation code.

    Another option is to show your form inside DLL as a modal form. In that case, your form will remain on the screen until you close it:

    MyForm.ShowModal;
    

    Also please take note that in your current code Application object in your DLL does not necessarily refer to Application object in your caller application, unless you send Application.Handle from caller application to the DLL.

    It is better that you change your DLL procedure to a code like this:

    procedure StartApp;
    begin
      with TMyForm.Create(nil) do
      try
        ShowModal;
      finally
        Free;
      end;
    end;
    

    Regards

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've just moved several referenced DLL's out of a project's bin folder and into
Is there a way you can run your UnitTest project against a compiled DLL
Are there any import and export tools that would let us move projects into
I have several related CVS projects, and I'd like to move them into subdirectories
I'm a Git newbie. I recently moved a Rails project from Subversion to Git.
I moved a typed dataset from one project to an ASP Web Application project.
I have just moved from phase 1 to phase 2 of a project. In
I have an application that was in a folder named project, I moved all
I moved a bunch of projects to Solution Folders to chop up our list
When I move .xaml and .xaml.vb files to a new Silverlight project, the generated

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.