🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.pascal.delphi.misc
Article #596

Passing a string to a DLL procedure with PChar

#596
From: Le Doute
Date: Wed, 03 Mar 1999 00:00
33 lines
2086 bytes
Hi,

I'm a certainly not an expert in object pascal, and I've just ran into some
trouble:

I need to convert one of my app (some kind of "utility") into a DLL to sell
what it does without selling its source (!). I can convert my app to a DLL
that would require only few inputs.

I need to pass to the DLL some strings. But ObjPascal has its own way to
manage strings which are not compatible with other compilers.  Using
ShareMem as Borland recommands isn't really what I want.

I have no experience with pointers so I would need some help:

My DLL needs to receive a string.

How can I export this string to the DLL through a pointer, and how do I
reconvert the pointer to a string inside my DLL? And "vice-versa", how can I
import a DLL output through a pointer.

For now, my code would look like this:

procedure ProcedureInsideTheDLL (Input:String; Output:String);




Thanks,

Louis Pelletier, Qu�bec

(I'm sorry for my english, BTW...)
Technical Details
Message-ID: <2niD2.930$_n2.20928@carnaval.risq.qc.ca>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: fd817,37896915cd1a101c,start
X-Google-Attributes: gidfd817,public
X-Google-Thread: 1043cf,37896915cd1a101c,start
X-Google-Attributes: gid1043cf,public
X-Google-Thread: f973d,37896915cd1a101c,start
X-Google-Attributes: gidf973d,public
X-Google-Thread: 10baee,37896915cd1a101c,start
X-Google-Attributes: gid10baee,public
X-Google-Thread: 108b0b,37896915cd1a101c,start
X-Google-Attributes: gid108b0b,public
X-Google-Thread: 105ac8,37896915cd1a101c,start
X-Google-Attributes: gid105ac8,public
From: "Le Doute" <ledoute@sceptiques.qc.ca>
Subject: Passing a string to a DLL procedure with PChar
Date: 1999/03/03
Message-ID: <2niD2.930$_n2.20928@carnaval.risq.qc.ca>
X-Deja-AN: 450913547
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3155.0
X-Trace: carnaval.risq.qc.ca 920498750 132.203.194.30 (Wed, 03 Mar 1999 17:05:50 EDT)
NNTP-Posting-Date: Wed, 03 Mar 1999 17:05:50 EDT
Newsgroups: comp.lang.pascal.delphi.misc,alt.comp.borland-delphi,alt.comp.lang.borland-delphi,alt.lang.delphi,borland.public.delphi.objectpascal,cern.delphi.general