Solved

String parameter in Delphi DLL

Posted on 2006-11-23
5
2,188 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
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Convert Jpg /PNG To GIF 5 138
Delphi IDE crash without error message ... 7 91
Delphi: making a BW image transparent 10 40
Delphi Seattle StructureView color 1 5
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
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…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

822 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