Page 1 of 1
Aladdin Hasp Security Keys
Posted: Tue Oct 16, 2007 5:04 am
by sbunyan
Hi all,
I was wondering if it is possible to call a dll function which will allow me to read information stored on Hasp security keys/dongles? For example, how to get the serial number from the key.
Thanks in advance,
Sinead
Posted: Tue Oct 16, 2007 3:22 pm
by Gizm0
As long as hasp company provides a native Win32 Dll to call the function from, yes it can be done.
Posted: Thu Oct 18, 2007 8:33 am
by sbunyan
Hi,
I have the following dll functions which I need to call, they are declared as follows:
extern "C" __declspec(dllexport) int CheckRegCode(int Version, char *UserName,char *RegCode,int& Result,int &Status);
extern "C" __declspec(dllexport) int IsDongleBitSet(int Bit,int& Result,int& Status);
extern "C" __declspec(dllexport) int GetDongleStatus(int& Status);
However when I try to reference these in a simple InstallAware project I am getting FUNCTIONNOTFOUND.
I use the following code in my InstallAware project:
Set Variable ReturnCode to Test
Set Variable Result to
Call DLL Function DmmDon.dll->GetDongleStatus (get result into variable ReturnCode)
MessageBox: $ReturnCode$
I read a post on this forum which recommended putting the dll into the support files section, which I have also tried but to no avail. (Note: when I put the dll into the support files section I then use
Call DLL Function $SUPPORTDIR$\\DmmDon.dll->GetDongleStatus (get result into variable ReturnCode)
Any ideas on why this isn't working?
Thanks,
Sinead
Posted: Thu Oct 18, 2007 11:40 am
by Alex_Ronquillo
please post the Call Dll Function line just by copying it, not as text so we can see if you are calling it right
Posted: Thu Oct 18, 2007 11:43 am
by sbunyan
Hi,
On further inspection into my dll code, I saw that to call the functions I need to prefix with an underscore '_'. I am using the C calling convention.
All is working fine now. Thanks for your reply.
Regards,
Sinead