?
Solved

String parameter in Delphi DLL

Posted on 2006-11-23
5
Medium Priority
?
2,200 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 240 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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.

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…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses

765 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