Examples do not compile in Delphi2009

Post here messages if you have any problems with working of Enigma Protector
Post Reply
PStadler
Posts: 22
Joined: Sun Oct 18, 2009 7:14 pm

Examples do not compile in Delphi2009

Post by PStadler »

Hello,
I am a registered user of Enigma Protector.
I could already protect all my software with it, without changing a line in my source.
This works fine for Delphi2006
as well as Delphi 2009 programs. :)
But now I want to create Licenses for programs compiled in Delphi2009
There are many compilation problems with some Delphi examples. :?: I am using Version 1.79.

If I use example keygen in Delphi 2006 everything is ok. It does not compile in Delphi 2009. So I change all strings to ansistring and all char to ansichar.
It then compiles with many warnings.
[DCC Warnung] main.pas(349): W1057 Implicit string cast from 'AnsiString' to 'string'
[DCC Warnung] main.pas(430): W1057 Implicit string cast from 'AnsiString' to 'string'
[DCC Warnung] main.pas(645): W1057 Implicit string cast from 'AnsiString' to 'string'
[DCC Warnung] main.pas(645): W1058 Implicit string cast with potential data loss from 'string' to 'AnsiString'
[DCC Warnung] main.pas(648): W1057 Implicit string cast from 'AnsiString' to 'string'
[DCC Warnung] main.pas(648): W1058 Implicit string cast with potential data loss from 'string' to 'AnsiString'
[DCC Warnung] main.pas(654): W1057 Implicit string cast from 'AnsiString' to 'string'
[DCC Warnung] main.pas(654): W1058 Implicit string cast with potential data loss from 'string' to 'AnsiString'
[DCC Warnung] main.pas(682): W1057 Implicit string cast from 'AnsiString' to 'string'
[DCC Warnung] main.pas(718): W1057 Implicit string cast from 'AnsiString' to 'string'
[DCC Warnung] main.pas(718): W1058 Implicit string cast with potential data loss from 'string' to 'AnsiString'
[DCC Warnung] main.pas(721): W1057 Implicit string cast from 'AnsiString' to 'string'
[DCC Warnung] main.pas(721): W1058 Implicit string cast with potential data loss from 'string' to 'AnsiString'
[DCC Warnung] main.pas(727): W1057 Implicit string cast from 'AnsiString' to 'string'
[DCC Warnung] main.pas(727): W1058 Implicit string cast with potential data loss from 'string' to 'AnsiString'
[DCC Warnung] main.pas(755): W1057 Implicit string cast from 'AnsiString' to 'string'

And it does not work as expected. If I enter an user name and press the "Generate" Button I get
EP_ERROR_PRIVATEKEYISINVALID.


So when will you translate your examples to Delphi2009, that they can be used out of the box?

Sincerely

Peter
Enigma
Site Admin
Posts: 3085
Joined: Wed Aug 20, 2008 2:24 pm

Re: Examples do not compile in Delphi2009

Post by Enigma »

Hi Peter!

Yes, this is known problem, one more thread is run there:
http://enigmaprotector.com/forum/viewto ... ?f=6&t=135

Problem is due to D2009 have changed "pchar" type to "pwidechar" but all previous versions had "pansichar" type.

To solve problem just rename any PCHAR types to PANSICHAR, everything will work fine!

I've quickly changed enigma_keygen_ide.pas to make it compatible with D2009, examples - try to remake yourself.

I've added this bug in todo, hope in next version it will be solved!

Regards
Vladimir
Attachments
enigma_keygen_ide.zip
enigma_keygen_ide.pas D2009 compatible
(1.28 KiB) Downloaded 2125 times
PStadler
Posts: 22
Joined: Sun Oct 18, 2009 7:14 pm

Re: Examples do not compile in Delphi2009

Post by PStadler »

Hello,

I have now also changed PChar to PAnsiChar. This compiles ok, but does not work as expected.
If I enter an user name and press the "Generate" Button I get
EP_ERROR_PRIVATEKEYISINVALID.

If I compile it in Delphi2006, also with this "Ansi" changes everything runs as expected. Maybe you could convert all examples to ansi?

Sincerely

Peter
Enigma
Site Admin
Posts: 3085
Joined: Wed Aug 20, 2008 2:24 pm

Re: Examples do not compile in Delphi2009

Post by Enigma »

Ok, I will try to download D2009 trial and check this out...

Probably, if you have a time, try to test it, for example, when you assign private key, do it as following:

Code: Select all

kg.PrivateKey := PAnsiChar(AnsiString('19VRB95TKY456YC48LBS9FK34YN080VVPDJPPKU6XA9EPLX7HTVN3VS'));
Will try to solve this as soon as possible!
PStadler
Posts: 22
Joined: Sun Oct 18, 2009 7:14 pm

Re: Examples do not compile in Delphi2009

Post by PStadler »

Hello,
If i do this....
Enigma wrote:Ok, I will try to download D2009 trial and check this out...

Probably, if you have a time, try to test it, for example, when you assign private key, do it as following:

Code: Select all

kg.PrivateKey := PAnsiChar(AnsiString('19VRB95TKY456YC48LBS9FK34YN080VVPDJPPKU6XA9EPLX7HTVN3VS'));
Will try to solve this as soon as possible!
I get the compilation errors:
[DCC Fehler] main.pas(118): E2010 Incompatible types: 'AnsiChar' and 'Char'
[DCC Fehler] main.pas(121): E2010 Incompatible types: 'AnsiChar' and 'Char'
[DCC Fehler] main.pas(134): E2010 Incompatible types: 'AnsiChar' and 'Char'
[DCC Fehler] main.pas(139): E2010 Incompatible types: 'AnsiChar' and 'Char'
[DCC Fehler] main.pas(154): E2010 Incompatible types: 'AnsiChar' and 'Char'
[DCC Fehler] main.pas(160): E2010 Incompatible types: 'AnsiChar' and 'Char'
[DCC Fehler] main.pas(186): E2010 Incompatible types: 'AnsiChar' and 'Char'
[DCC Fehler] main.pas(196): E2010 Incompatible types: 'AnsiChar' and 'Char'
[DCC Fehler] main.pas(233): E2010 Incompatible types: 'AnsiChar' and 'Char'
[DCC Fehler] main.pas(248): E2010 Incompatible types: 'AnsiChar' and 'Char'
[DCC Fehler] main.pas(296): E2010 Incompatible types: 'AnsiChar' and 'Char'
[DCC Fehler] main.pas(316): E2010 Incompatible types: 'AnsiChar' and 'Char'


Sincerely

Peter
Enigma
Site Admin
Posts: 3085
Joined: Wed Aug 20, 2008 2:24 pm

Re: Examples do not compile in Delphi2009

Post by Enigma »

Peter,

I've solved problem with keygen for Delphi 2009! Download attached delphi example and enigma_keygen_ide.pas

These files will be included in the next release!

Also, soon I make a unicode version of registration API and keys generator.

Regards
Vladimir
Attachments
enigma_keygen_ide.zip
enigma_keygen_ide.pas
(1.29 KiB) Downloaded 2059 times
Delphi.zip
Keygen Delphi Example
(161.18 KiB) Downloaded 2051 times
PStadler
Posts: 22
Joined: Sun Oct 18, 2009 7:14 pm

Re: Examples do not compile in Delphi2009

Post by PStadler »

Vladimir,

The keygen example works now as it should. Hope you can soon make a new release with all examples working.

Sincerely

Peter
Post Reply