change you code to
ErrList := TStringList.Create;
try
URI := GenerateReport(ADOConnection, rfPDF,ParamList.Text, ErrList.Text,
'logo.jpg');
and for the dll
function GenerateReport(ADOConnection: TADOConnection; Format:TReportFormat;
ParamList: String; ErrList: String; BitMapFileName: String; const bCopy:
Boolean = false): string;
var
serrlist : tstringlist;
begin
serrlist:=tstringlist.create;
serrlist.text:=errlist;
..
..
..
serrlist.add('whatever')// this should be good
passing a vcl object to a dll isnt as simple as 123 - its not recommended;
its better you pass the properties (hoping that they are simple datatypes)
then reconstruct the object in the dll for use; or use bpl's all together.
if you dont mind my asking; why use a dll?
chris
----- Original Message -----
From: "louis" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Thursday, July 07, 2005 12:28 PM
Subject: [delphi-en] DLL issue
> Hi there
>
> I've got a StringList which I create in an application and then pass
> this as a var parameter in an exported function to a DLL. But when I try
> to use the StringList in the DLL, I get an access violation.
>
> So here's the call to the exported function:
>
> ErrList := TStringList.Create;
> try
> URI := GenerateReport(ADOConnection, rfPDF,
> ParamList, ErrList, 'logo.jpg');
>
> And in the DLL:
>
> function GenerateReport(ADOConnection: TADOConnection; Format:
> TReportFormat;
> ParamList: TStringList; var ErrList: TStringList; BitMapFileName:
> String; const bCopy: Boolean = false): String;
>
> Begin
> ........
> ........
> ........
>
> ErrList.Append('whatever'); // Access violation here
>
> End;
>
> The Stringlist is only passed as a var parameter. I'm not trying to
> create it again, but still I get the access violation. Can anyone shed
> some light on the subject?
>
> Cheers
> Louis
>
>
>
> -----------------------------------------------------
> Home page: http://groups.yahoo.com/group/delphi-en/
> To unsubscribe: [EMAIL PROTECTED]
> Yahoo! Groups Links
>
>
>
>
>
>
>
-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED]
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/delphi-en/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/