> it is not problem of Synapse, but BCB2007.

Well, I disagree. Synapse claims to be compatible with C++Builder, and one
of the 'rules' for achieving this is not to return arrays from functions.

> Change line to: extern PACKAGE TIp6Bytes * __fastcall StrToIp6(AnsiString
value);

Sorry, but that is wrong. StrToIp6 does NOT return a pointer, so attempting
to call the function would almost certainly crash due to incorrect stack
cleanup.

But, there's another way round this that I've just successfully implemented:
Use $EXTERNALSYM/$HPPEMIT to 'redefine' the TIp6Bytes type in a compatible
way.

{$EXTERNALSYM TIp6Bytes }
(*$HPPEMIT 'struct TIp6Bytes { Byte bytes[16]; };' *)

Any .cpp code using TIp6Bytes would then  access the .bytes struct member.

This requires no changes to Delphi code (in either synapse library or client
code), and there can't be many C++ users of this version so far...

In an ideal world, the Delphi HPP generation could be smart enough to do
this automagically, but that would probably break a lot of backwards
compatibility.

Regards,
  Roddy
------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
synalist-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/synalist-public

Reply via email to