Passing parameters from Delphi 5 to Delphi DLL XE

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.
Who is Participating?
Sinisa VukConnect With a Mentor Commented:

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;

fcobandaAuthor Commented:
excuse my English
Ephraim WangoyaCommented:

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
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

fcobandaAuthor Commented:

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.

Ephraim WangoyaCommented:

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

fcobandaAuthor Commented:

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;

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.