[Last Call] Learn how to a build a cloud-first strategyRegister Now


Passing parameters from Delphi 5 to Delphi DLL XE

Posted on 2011-10-27
Medium Priority
Last Modified: 2013-11-23
which is the correct way to pass parameters to an application in Delphi 5 to Delphi dll XE, as does the conversion from one application to another. and also because I want to use the DLL that contains forms and that such behavior within the main application (Delphi 5) as a MDIChild.
Question by:fcobanda
  • 3
  • 2

Author Comment

ID: 37041110
excuse my English
LVL 32

Expert Comment

by:Ephraim Wangoya
ID: 37041807

What exactly do you mean by correct way of passing parameters?

If you want to pass strings use PWideChar

You can pass records, pointers and any other simple data structures

For forms, just call the function in the dll that opens the form

Author Comment

ID: 37041844

have some sample code, how should I send the parameter and as I have the code in the DLL?, if possible, any additional comment PARAMETER classes who told me.

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

LVL 32

Expert Comment

by:Ephraim Wangoya
ID: 37042254

what is the signature of the function in the dll you need to call?


Author Comment

ID: 37046500

main application
function Modulo_Pptos_Operacion(No_Orden : Integer; pathBD : string; PathBDConf : String) : Integer ; stdcall;
 external 'LIB_Pptos_Oper.dll';

   DmDatos.CiasPATHA.Value, PathDBConfig);

and must be declared in the DLL for you to pass parameters correct?
So I have it now

Modulo_Pptos_Operacion function (No_Orden: Integer; PathDB: String; PathDBConfig: String): Integer; StdCall;

LVL 28

Accepted Solution

Sinisa Vuk earned 2000 total points
ID: 37069415

Because Delphi Xe String <> Delphi 5 String, better is using pointers.
You must recompile dll with declaration in it:

Modulo_Pptos_Operacion function (No_Orden: Integer; PathDB: PChar; PathDBConfig: PChar): Integer; StdCall;


Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Integration Management Part 2
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

825 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question