Recent

Author Topic: problem with zeosdb 7.0.3 on wince  (Read 5693 times)

pcler

  • New Member
  • *
  • Posts: 13
problem with zeosdb 7.0.3 on wince
« on: March 13, 2013, 01:36:21 pm »
hello,

i have written a little application with lazarus 1.0.6 and zoesdb  7.0.3 which works fine under windows xp.
Now i want to compile under wince and got the following error message
...src/core/ZCompatibility.pas(430,33) Error Identifizier not found "AnsiToStringEx"


has anyone an idea where or what the mistake is?

thanks
pcler

goodname

  • Sr. Member
  • ****
  • Posts: 297
Re: problem with zeosdb 7.0.3 on wince
« Reply #1 on: March 13, 2013, 03:14:04 pm »
Don't know what is going on and guess that there are very few that have tried ZEOS on WinCE. It could be missing libraries on the WinCE.

Not sure that it is a good thing to do this anyway as persistent connections are not reliable over wireless. There are some good TCP, HTTP connection libraries that work well on WinCE that can talk with middleware.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11458
  • FPC developer.
Re: problem with zeosdb 7.0.3 on wince
« Reply #2 on: March 13, 2013, 04:00:38 pm »
I think it is an ifdef problem. WinCE api is mostly unicode by default, and thus defines unicode. (this goes back to 2.2.0 times, 2007)

However newer Delphi (2009+) also have moved to unicode and also use symbol unicode to identify.

In short, Zeos thinks that because of symbol unicode (which for wince only signals to use -W API functions as default), that functions from the D2009+ RTL are available.

I don't have an easy solution, this is the stuff that will require a full audit of the "unicode" symbol usage.

pcler

  • New Member
  • *
  • Posts: 13
Re: problem with zeosdb 7.0.3 on wince
« Reply #3 on: March 13, 2013, 05:51:38 pm »
thank you for your answers,

marcov you are right
i found in the file  ZEncoding.pas the function "AnsiToStringEx" in a ifdef (Unicode) - section.
Is there any way to change WinCE api to non Unicode?

thanks
pcler

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11458
  • FPC developer.
Re: problem with zeosdb 7.0.3 on wince
« Reply #4 on: March 13, 2013, 09:17:06 pm »
thank you for your answers,

marcov you are right
i found in the file  ZEncoding.pas the function "AnsiToStringEx" in a ifdef (Unicode) - section.
Is there any way to change WinCE api to non Unicode?

No, wince only supports unicode.  You could try to use FPC 2.7.1 though (trunk), it is a bit more later delphi like.

EgonHugeist

  • Jr. Member
  • **
  • Posts: 78
Re: problem with zeosdb 7.0.3 on wince
« Reply #5 on: March 14, 2013, 12:36:55 am »
Tanks Marco,

I don't know anything about WinCe.  But the function which is not available, i've made in the past. I think you're right with your ifdef suggestion. I proposed pcler a possible workaround:

Open ZeosLazarus.inc an exchange the last three lines with:

{$IF defined(WITH_LCONVENCODING) and ((defined(MSWINDOWS) and not defined(WinCE)) or defined(FPC_HAS_BUILTIN_WIDESTR_MANAGER))}
{$UNDEF WITH_LCONVENCODING}
{$IFEND}

This should tell Zeos that the function AnsiToStringEx/StringToAnsi are not available on FPC2.6 and below.

I hope it helps. If so than i'll commit the change emmediatly.

pcler

  • New Member
  • *
  • Posts: 13
Re: problem with zeosdb 7.0.3 on wince
« Reply #6 on: March 14, 2013, 07:20:00 pm »
Thanks EgonHugeist,

i test your workaround and got the same Error-message.

i change it to
{$IF defined(WinCE)}
{$UNDEF WITH_LCONVENCODING}
{$IFEND}
and receive an Error in in ZPlainLoader.pas(189,47) incompatible type for arg no. got "pchar" ecpected "pwidechar"



marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11458
  • FPC developer.
Re: problem with zeosdb 7.0.3 on wince
« Reply #7 on: March 15, 2013, 09:41:42 am »
Open ZeosLazarus.inc an exchange the last three lines with:

{$IF defined(WITH_LCONVENCODING) and ((defined(MSWINDOWS) and not defined(WinCE)) or defined(FPC_HAS_BUILTIN_WIDESTR_MANAGER))}
{$UNDEF WITH_LCONVENCODING}
{$IFEND}

Note that _any_ usage unicode directive must be checked. IOW, see wince as something where unicode ONLY signifies that the windows unit is like in D2009, not the rest.

 IOW this will possibly fix, but break on the next ifdef unicode.

 

TinyPortal © 2005-2018