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.
fcobandaAsked:
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;


0
 
fcobandaAuthor Commented:
excuse my English
0
 
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
0
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:
ewangoya:

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.

thanks
0
 
Ephraim WangoyaCommented:

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

0
 
fcobandaAuthor Commented:

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

Modulo_Pptos_Operacion(DmDatos.OrdenesNO_Orden.AsInteger,
   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;


0
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.