[fpc-pascal] Delphi 2010 code crashing in Lazarus (0.9.30, Win32)

2011-04-13 Thread Paul Nicholls
Hi all,
  I have a DLL that was compiled using Delphi 2010 (or Delphi XE, not sure 
which...), and this DLL uses PWideString in a bunch of it's interfaces.

I have some code that uses the DLL which runs fine using D2010, but crashes 
using Lazarus 0.9.30, Win32.  The debugger is being less than helpful in 
allowing me to track down the problem (big AAARRR!!!).

Does Lazarus/Freepascal have WideString/AnsiString support (mixing types 
too) out of the box like D2010, or do I have to do different things with 
Lazarus code when mixing WideString/AnsiString values and assignments?

cheers,
Paul
-- 
The plastic veneer of civilization is easily melted in the heat of the 
moment - Paul Nicholls 



___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Delphi 2010 code crashing in Lazarus (0.9.30, Win32)

2011-04-13 Thread Sven Barth

Am 13.04.2011 09:06, schrieb Paul Nicholls:

Hi all,
   I have a DLL that was compiled using Delphi 2010 (or Delphi XE, not sure
which...), and this DLL uses PWideString in a bunch of it's interfaces.

I have some code that uses the DLL which runs fine using D2010, but crashes
using Lazarus 0.9.30, Win32.  The debugger is being less than helpful in
allowing me to track down the problem (big AAARRR!!!).

Does Lazarus/Freepascal have WideString/AnsiString support (mixing types
too) out of the box like D2010, or do I have to do different things with
Lazarus code when mixing WideString/AnsiString values and assignments?


You might experience the same problem I had reported here: 
http://bugs.freepascal.org/view.php?id=14308 (that reminds me that I 
need to test that patch... -.- )


Regards,
Sven
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] Re: TMenu - barbreak Delphi Compatbility.

2011-04-13 Thread Ben
On 13/04/2011 00:08, Paul Ishenin wrote:
 
 This is a windows only feature and it is not implemented in lazarus.


Actually, OS/2 also supports that feature (though rarely used)...but
then Lazarus doesn't have an OS/2 native port yet. ;-)



-- 

Ben.

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Re: android share library with classes unit

2011-04-13 Thread Felipe Monteiro de Carvalho
Have you done Step 2 described here:

http://wiki.lazarus.freepascal.org/Android_Interface#Using_the_pre-compiled_compiler

?

I know that those instructions are different from what you are doing,
but Step 2 should apply anyway.

-- 
Felipe Monteiro de Carvalho
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Re: android share library with classes unit

2011-04-13 Thread darekm
 I use this binutils http://www.gnu.org/software/binutils/
 using this command to build crosscompiler

 make clean crossinstall CPU_TARGET=arm OS_TARGET=linux
 CROSSBINDIR=/usr/share/fpcsrc/binutils/ OPT=-dFPC_ARMEL -O- -gl
 CROSSOPT=-dANDROID -CpARMv6 -gl -CfSOFT -O-

CROSSOPT=-dANDROID -CpARMv6  -dFPC_ARMEL 


I've trace Your debug log.  Bug is on line  where library is loaded.
It seems be corrupted. I always had once more line with absent of dlopen

D/dalvikvm( 1082): Trying to load lib
/data/data/com.herux.hellojni/lib/libhellojni.so 0x44e7ea48

here something with dlopen, I don't remember exactly.
^^^
I/DEBUG   (   31): *** *** *** *** *** *** *** *** *** *** *** *** *** ***
*** ***


Darek

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] android share library with classes unit

2011-04-13 Thread Thomas Schatzl

Hi,

On Tue, 12 Apr 2011 02:56:39 -0700 (PDT), herux wrote:
I managed to compile and run the library for android on emulator, 
which I

compile the project just a libhellojni.so

compile using paramater like this

ppcarm -Scghi -O1 -Parm -gl -b -B -XX -Xc -XD -CpARMv6 -CfSOFT 
-dandroid

-vewnhi -l -XParm-linux-
-Fi/home/herux/workspace/hellojni/jni/lib/arm-linux/ -Fu. 
-FUlib/arm-linux/

-o../libs/armeabi/libhellojni.so -FD/usr/share/fpcsrc/binutils/
hellojni.lpr

[...]

then I try to use classes unit or sysutils, the project succeeded in
compiling, but the library did not loaded by the emulator. there is 
an error

SIGSEGV


Fyi, there is an unresolved issue with Android shared library 
initialization code which affects the use of the sysutils unit, see 
http://bugs.freepascal.org/view.php?id=18833 for more details.


Thomas

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Inherit interface from 2 interfaces

2011-04-13 Thread Zaher Dirkey
On Tue, Apr 12, 2011 at 11:42 AM, michael.vancann...@wisa.be wrote:



 On Tue, 12 Apr 2011, Andreas Dorn wrote:

  On Fri, 8 Apr 2011,michael.vancanneyt worte:

 The whole idea of interfaces is to avoid multiple inheritance.

  Hm. I don't believe that.

 One of the major points of interfaces is indeed to avoid the problems
 of multiple class inheritance (diamond problems - i.e. problems caused by
 conflicting implementations of a method in different ancestor classes).

 But Interfaces themselves don't have an implementation, so those
 diamond problems simply don't exist for them.


 Of course they do. If they inherit from 2 interfaces that have the same
 method with a different signature, you have a problem.

 InterfaceA = Interface
  Function IsValid : Integer;
 end;

 InterfaceB = Interface
  Function IsValid : String;
 end;

 How to define :

 InterfaceC = Interface(InterfaceA,InterfaceB)


I think, compile raise error duplicated methods, Same if inherit from one
and add a method already exists in parent interface.

Regards

-- 
Zaher Dirkey
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] TMenu - barbreak Delphi Compatbility.

2011-04-13 Thread Zaher Dirkey
On Wed, Apr 13, 2011 at 12:08 AM, Paul Ishenin webpi...@mail.ru wrote:

  12.04.2011 21:52, Justin Smyth wrote:

 Guys.

 In Delphi you can set the break to barbreak to break the menu in half ,
 whats the best way ( if possible to do this in lazarus ) ?


 This is a windows only feature and it is not implemented in lazarus.


And it is not work for Right To Left in Delphi or any application Windows

Regards
-- 
Zaher Dirkey
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

[fpc-pascal] Re: android share library with classes unit

2011-04-13 Thread herux
My problem is resolved, I apply the patch contained in that link. reported by
Dejan Boras.
then rebuild cross compiler with this:

make clean crossinstall CPU_TARGET=arm OS_TARGET=linux
CROSSBINDIR=/usr/share/fpcsrc/binutils OPT=-dFPC_ARMEL -O- -gl
CROSSOPT=-dANDROID -CpARMv5 -gl -CfSOFT -O-

now it's work. libhellojni.so loaded succesfully.

thanks

herux

-
-
--
View this message in context: 
http://free-pascal-general.1045716.n5.nabble.com/android-share-library-with-classes-unit-tp4297859p4300489.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] generic, specialize keywords in mode delphi in FPC trunk

2011-04-13 Thread Sven Barth

Am 12.04.2011 00:05, schrieb Paul Ishenin:

12.04.2011 4:22, cobines wrote:

Hello.

Following program:

program a;
{$mode delphi}
type
generic TGenT = class end;
TSpc = specialize TGenInteger;
begin
end.

compiles with FPC 2.4.2, but not with 2.5.1 rev. 17306:

a.pas(4,11) Fatal: Syntax error, = expected but identifier TGEN found
a.pas(5,21) Error: Identifier not found specialize
a.pas(5,21) Error: Error in type definition
a.pas(5,21) Fatal: Syntax error, ; expected but identifier TGEN found

generic and specialize are not allowed in delphi mode in 2.5.1 but
they are required in 2.4.2.

Is this a conscious change? There is no mention of this on Wiki User
Changes 2.4.4 or User Changes Trunk pages.

In mode delphi FPC understands delphi generic syntax. I did not write a
line to the

User Changes Trunk because this work is not finished. But looking at my
free time I don't think it will be finished by me, so I will add a note
there today.


Would you mind if I'd try to continue/finish that work?

Regards,
Sven
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] generic, specialize keywords in mode delphi in FPC trunk

2011-04-13 Thread Paul Ishenin

13.04.2011 21:51, Sven Barth wrote:

Would you mind if I'd try to continue/finish that work?


Please do.

Best regards,
Paul Ishenin
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal