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

  • SEARCH
  • Home
  • 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 4076104
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T17:22:58+00:00 2026-05-20T17:22:58+00:00

My application has to provide the ability of calling different functions and procedures from

  • 0

My application has to provide the ability of calling different functions and procedures from external DLLs. So we don’t know parameters’ count and their types. What should I do to do this?

Let me explain it more. My application is a RAD tool and it has its own scripting and syntax… I want to let users to use ANY dll file and call any function or procedure they want. I can’t use the simple method of calling dll (LoadLibrary and then GetProcAddress) because I don’t know what type the GetProcAddress refers to ( var Proc:procedure (A:??;B:??;...) ).

  • 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-20T17:22:59+00:00Added an answer on May 20, 2026 at 5:22 pm

    This is a simple example that works on my machine, but I am not an expert on the subject.

    procedure TForm4.Button1Click(Sender: TObject);
    var
      hmod: HMODULE;
      paddr: pointer;         
      c1, c2, ret: cardinal;
    begin
      c1 := 400; //frequency
      c2 := 2000; // duration
    
      hmod := LoadLibrary('kernel32'); // Of course, the name of the DLL is taken from the script
      if hmod <> 0 then
        try
          paddr := GetProcAddress(hmod, 'Beep'); // ...as is the name of the exported function
          if paddr <> nil then
          begin
            // The script is told that this function requires two cardinals as
            // arguments. Let's call them c1 and c2. We will assume stdcall
            // calling convention. We will assume a 32-bit return value; this
            // we will store in ret.
            asm
              push c2
              push c1
              call [paddr]
              mov ret, eax
            end;
          end;
        finally
          FreeLibrary(hmod);
        end;
    end;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My application has a need to let the user choose a date from a
My application has no forms. It runs by calling Application.Run();
The web application my organization has written to perform customer care functions doesn't have
I want to provide different parts of an application with independent Graphics instances which
In an alternate application, the user has the ability to update their address and
Has anyone integrated an iPhone application with a Shibboleth Identity Provider? Googling did not
Application has an auxiliary thread. This thread is not meant to run all the
Our application has a file format similar to the OpenDocument file format (see http://en.wikipedia.org/wiki/OpenDocument
My application has a command line interface, and I'm thinking about using the GNU
My application has just started exhibiting strange behaviour. I can boot it through the

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.