VMProtectBeginUltraLockByKey with Delphi

I set a correct Serial in Delphi and before call the locked procedure I confirmed that the Serial is Ok…

I confirmed also, that (VMProtectGetSerialNumberState() returns = SERIAL_STATE_SUCCESS = (0)

Where is the wrong here ???
My code is the below:

if (VMProtectGetSerialNumberState() = SERIAL_STATE_SUCCESS) then
begin
VMProtectBeginUltraLockByKey(‘LoginClick’);

// This is my procedure that must be locked with serial number
ConnectToServer();

VMProtectEnd;
end;

Thank you !

Sorry, I forgot to tell you that , even I have a right Serial when I press the button with the above code I sent you I get the following message:

This code requires valid serial number to run.
Program will be terminated.

Could you send us very simple example (original EXE+VMP files) that shows your problem?

Hello,

This is a link of an example project in Delphi with ‘VMProtectBeginUltraLockByKey’ (Includes: LockToSerial.exe, LockToSerial.vmp.exe):

https://drive.google.com/drive/folders/1eQwEweSa-S0uC8xJKl6WDTAbYuCC2At8?usp=share_link

Thank you and I hope to hear from you soon !

Dear Admin,

This is closed !

I found that the problem was in vmp file.
I created a new vmp file and the problem solved !

Thank you very much !