Page 1 of 1

Writing HWID to lineEdit in Qt

Posted: Mon Jun 30, 2014 11:01 am
by alex-s
Hey,
i tried to get the Hardware ID out of Enigma since other ways can be really complicated to get unique one.
So now my Problem:
Image
I just try to set the EP_RegHardwareID into the lineEdit but it wont work since its an LPCTSTR.
So i tried to set EP_RegHardwareID as an QString which also wont work and the lineEdit remains clear while it is protected.
I tried the same settings at the App out of the Plugin Forum here which does the same but in Delphi.
So i just need the same for C++ since ill use it to verify over a PHP script to the MySQL Database.

Re: Writing HWID to lineEdit in Qt

Posted: Mon Jun 30, 2014 3:23 pm
by Enigma
Hi, just to clarify, do you need only Hardware ID from Enigma Protector, don't you need protection/licensing?

Can you please also let me know, what exactly does not work in your sample, does it show empty string, or just does not compile?

Re: Writing HWID to lineEdit in Qt

Posted: Mon Jun 30, 2014 4:22 pm
by alex-s
Sorry for replying that late.
I just fixed it.
Had to convert to char* also i compiled in unicode before so there was the issue which i fixed.
If anyone else needs it for Qt:

Code: Select all

LPCTSTR s = EP_RegHardwareID();
	char* hwid = const_cast<char*>(s); // LPCTSTR  HardwareID -> char
	return hwid; // returns the hwid if in an method
Also try to use the Visual Studio Add-In to support Multi-Byte Characters.

Re: Writing HWID to lineEdit in Qt

Posted: Wed Jul 02, 2014 10:33 am
by Enigma
Thanks Alex, that's very useful!