String parameter in Delphi DLL

I'm using Turbo Delphi for Win32
and I'm writing a DLL that should be used with other Delphi application (Turbo Delphi or Delphi 7 application) should I use stdcall or keep default fast call, and what about string paramer and shared library (The comment in Turbo Delphi's DLL header), is using PChar instead of using shared memory libraries is somthing linked to stdcall for non-Delphi applications, or even if I use Delphi in DLL caller I should use PChar instead of string.

Motaz
LVL 7
MotazAsked:
Who is Participating?
 
alkisgCommented:
You may use String, the (Delphi) DLL will use the Delphi memory manager, string referencing etc, so no problem there.
0
 
2266180Commented:
it is better to use pchar, especially if you want to use the dll from non-delphi environments. the stdcall is upto you how you are managing the data: you can look in delphi help to see exactly which calling convensiont you rpeffer, but usually stdcall is ok.
0
 
BlackTigerXCommented:
using PChar and stdcall should work just fine, and allows you to use the DLL from non-Delphi programs too
0
 
MotazAuthor Commented:
Is that means I can not use String if I'm using only Delphi in calling?
0
 
MotazAuthor Commented:
It is working just fine using string without stdcall,
and that's the part I was searching for "the (Delphi) DLL will use the Delphi memory manager, string referencing"
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.