Solved

String parameter in Delphi DLL

Posted on 2006-11-23
5
2,191 Views
Last Modified: 2008-01-09
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
0
Comment
Question by:Motaz
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 28

Expert Comment

by:2266180
ID: 18004408
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
 
LVL 13

Expert Comment

by:BlackTigerX
ID: 18004516
using PChar and stdcall should work just fine, and allows you to use the DLL from non-Delphi programs too
0
 
LVL 7

Author Comment

by:Motaz
ID: 18009223
Is that means I can not use String if I'm using only Delphi in calling?
0
 
LVL 9

Accepted Solution

by:
alkisg earned 60 total points
ID: 18009279
You may use String, the (Delphi) DLL will use the Delphi memory manager, string referencing etc, so no problem there.
0
 
LVL 7

Author Comment

by:Motaz
ID: 18011450
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

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

734 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