> G'Day, > > I have a recollection that passing string paramaters to a C DLL is "not a > good thing" from a Delphi perspective and that PChars should be used > instead. Can someone please refresh my memory as to why this is so?
Just create a new DLL project and you get this comment: { Important note about DLL memory management: ShareMem must be the first unit in your library's USES clause AND your project's (select Project-View Source) USES clause if your DLL exports any procedures or functions that pass strings as parameters or function results. This applies to all strings passed to and from your DLL--even those that are nested in records and classes. ShareMem is the interface unit to the BORLNDMM.DLL shared memory manager, which must be deployed along with your DLL. To avoid using BORLNDMM.DLL, pass string information using PChar or ShortString parameters. } So yeah, not a 'good thing' in some cases :-) If you're going to use the DLL with programs written in other languages it could ba a problem as well I think (i.e. VC++ and Delphi strings are handled differently in memory I think - anyone?) --------------------------------------------------------------------------- New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED] Website: http://www.delphi.org.nz To UnSub, send email to: [EMAIL PROTECTED] with body of "unsubscribe delphi" Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/