[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

String parameter in Delphi DLL

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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

649 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