Quoting Colin Fraser <[EMAIL PROTECTED]>:

> Hi all,
> 
> I am just wondering exactly how one should go about passing strings in
> structures to API calls...
snip

> If I explicitly create a PChar and allocate space for it and assign the
> attachment string to it, it all works fine...
> Just more work involved making sure that you latter free the space assigned
> to all the strings for each attachment...
> 
> Just wondering why the first method doesn't work for multiple attachments.

What happens if you assign Attachment [i] to a string variable and then cast 
that to the PChar?

>From experience I have struck problems before when casting a function call 
result, this may have something to do with it not being a variable. In your 
case there may be something in converting what is effectively an array element 
without affecting other elements in the same array.  The best I have found with 
PChar is to only cast it over string literals or variables.
---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to