I'm just testing the manual key generation process.
If I edit an order and go to Registration Info, and I have ensured that rkkeygen.dll is compiled as sample supplied (no change) and it resides next to regkeeper.exe.
Then I click the generate button.
Shouldn't I see 'SomeGeneratedKey' in the Registration Ket (UnlockCode) edit box?
What else do I need to get this test working?
Alan
Key Generation
Yes, you must see the generated key in the Registration Key field. If it is not there then it looks like something wrong. Please check:
1. There is no Custom Key Generator defined for the order product.
2. Order contains product listed.
If this still fails please let me know what sample DLL did you compile, may be there is something wrong with code.
Thank you.
1. There is no Custom Key Generator defined for the order product.
2. Order contains product listed.
If this still fails please let me know what sample DLL did you compile, may be there is something wrong with code.
Thank you.
Best regards,
Igor Siticov.
Igor Siticov.
I found one thing wrong with the sample code
procedure GenerateKey(KeyGenInfo: PKeyGenRecord;UnlockCode: PChar; var FileToAttach: PChar); export; stdcall;
insteads of this:
procedure GenerateKey(KeyGenInfo: PKeyGenRecord;var UnlockCode: PChar; var FileToAttach: PChar); export; stdcall;
i.e. no var for UnlockCode
but still no joy - I get a pointer back now - not the key string
I've tried nothing in the custom key generator field and I've also specified the default one to amke sure - no difference.
The order does indeed contain product listed.
no joy yet.
Alan
procedure GenerateKey(KeyGenInfo: PKeyGenRecord;UnlockCode: PChar; var FileToAttach: PChar); export; stdcall;
insteads of this:
procedure GenerateKey(KeyGenInfo: PKeyGenRecord;var UnlockCode: PChar; var FileToAttach: PChar); export; stdcall;
i.e. no var for UnlockCode
but still no joy - I get a pointer back now - not the key string
I've tried nothing in the custom key generator field and I've also specified the default one to amke sure - no difference.
The order does indeed contain product listed.
no joy yet.
Alan
I've re-written the implementation to write the UnLockCode to a file. So I know my code works, but no matter what I try, the UnLockCode or the AttachFilename does not get returned, just what looks like a 4 byte pointer is returned (as per the procedure call) but it isn't getting read properly from RegKeeper as the appropriate string values.
(I think)
Alan
(I think)
Alan
The following code works just fine:
library testkeygen;
uses
SysUtils,
Classes,
Windows,
DateUtils;
type
PKeyGenRecord = ^TKeyGenRecord;
TKeyGenRecord = packed record
ProductID,
ProductName,
UserFName,
UserMName,
UserLName,
UserCompany,
UserEmail,
RegistrationName: PChar;
Quantity: Integer;
AllFields: PChar;
FieldsToModify: PChar;
FailOrder: Boolean;
end;
procedure GenerateKey(KeyGenInfo: PKeyGenRecord; var UnlockCode: PChar; var FileToAttach: PChar); export; stdcall;
const
SWarning = 'WARNING: This is a test warning message!'#13#10;
begin
Move(SWarning[1], UnlockCode, Length(SWarning));
end;
exports GenerateKey;
{$R *.res}
begin
end.
If it still doesn't work please try to specify the DLL for specific product and check if it works.
Please let me know if this helps.
library testkeygen;
uses
SysUtils,
Classes,
Windows,
DateUtils;
type
PKeyGenRecord = ^TKeyGenRecord;
TKeyGenRecord = packed record
ProductID,
ProductName,
UserFName,
UserMName,
UserLName,
UserCompany,
UserEmail,
RegistrationName: PChar;
Quantity: Integer;
AllFields: PChar;
FieldsToModify: PChar;
FailOrder: Boolean;
end;
procedure GenerateKey(KeyGenInfo: PKeyGenRecord; var UnlockCode: PChar; var FileToAttach: PChar); export; stdcall;
const
SWarning = 'WARNING: This is a test warning message!'#13#10;
begin
Move(SWarning[1], UnlockCode, Length(SWarning));
end;
exports GenerateKey;
{$R *.res}
begin
end.
If it still doesn't work please try to specify the DLL for specific product and check if it works.
Please let me know if this helps.
Best regards,
Igor Siticov.
Igor Siticov.