On 14-09-2022 23:09, Rik van Kekem wrote:


On 14-09-2022 13:32, Petr Kolář wrote:



I‘ve founded, that iconv.dll failed on a 64 bit system.

It raised exception $C0000005 access violation.

It works fine on 32 bit.

It also states this in synaicnv.pas:
// Content: ICONV support for Win32, OS/2, Linux and .NET 
So I guess Win64 isn't supported yet.

It is possible to create your own calls to iconv.dll (I tried) but you'll need 
to know the exact parameter structure (and that's where it goes wrong in 
synaicnv.pas).

BTW. Here is my working code of manually loading iconv.dll and calling iconv.

So the problems in synaicnv.pas are
*) the //IGNORE isn't supported anymore in newer versions
*) size_t needs to be UIntPtr (that one held me up a bit). I made it a psize_t 
(^size_t).
*) the parameters in the call to iconv ALL need to be pointers (and no var)

Of course these changes could be rolled into a separate lib but it would be 
better if someone could adjust synaicnv.pas.
(This was just testing a bit to see if I could get it working.)



Thank you very much, Rik.

I finally found that the main problem is in the size_t type. I commented out 
the line:

   size_t = Cardinal;

Because Cardinal is 4-byte on both 32-bit and 64-bit systems, but the standard 
defined size_t = ULONG_PTR (=NativeUInt) is 4-byte on 32-bit and 8-byte on 
64-bit on WinApi.Windows. And that was the main problem. Changing all variables 
to pointers using the "@" prefix is not necessary.

It is therefore sufficient to use only the standard size_t type, everything 
else in synaicnv.pas can remain unchanged..

Petr

_______________________________________________
synalist-public mailing list
synalist-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synalist-public

Reply via email to