PureBasic Forum
http://forums.purebasic.com/english/

Problem with library
http://forums.purebasic.com/english/viewtopic.php?f=15&t=70560
Page 1 of 1

Author:  loulou2522 [ Fri Apr 13, 2018 1:02 pm ]
Post subject:  Problem with library

Here is the function in NetUnikey.h
long UniKey_Find_Next(WORD* pHandle, DWORD* pSetting1, DWORD* pSetting2);
and for the type
// MFC declare
#define WORD unsigned short
#define DWORD unsigned int
#define BYTE unsigned char

I try to use prototype but that's not working

Prototype.l ProtoUniKey_Find(pHandle.w, pSetting1.i, pSetting2.i)



Code:
result =  OpenLibrary(500,"NetUniKey.so")
  If result  =  0
    MessageRequester("EASY-SEPAmail"+Space(100),"Echec de chargement de la DLL Unikey_STD_32.dll"+#CRLF$+"Veuillez contacter votre administrateur",#PB_MessageRequester_Ok)
    End
  EndIf
 
  UniKey_Find.ProtoUniKey_Find = GetFunction(500, "UniKey_Find")
  Debug "ici"
  ;here the programm is suspended
  retcode = CallFunction(500,"UniKey_Find", @handle, @lp1.i, @lp2.i)


Author:  Mijikai [ Fri Apr 13, 2018 1:12 pm ]
Post subject:  Re: Problem with library

Code:
Prototype.l ProtoUniKey_Find(*pHandle,*pSetting1,*pSetting2)

Author:  loulou2522 [ Sat Apr 14, 2018 2:22 pm ]
Post subject:  Re: Problem with library

Code:
ImportC "NetUniKey.so"
  UniKey_Find(*pHandle, *pSetting1, *pSetting2)
  UniKey_User_Logon(*pHandle, *p1, *p2)
  UniKey_Logoff(*handle)
EndImport
retcode = UniKey_Find(@handle, @lp1, @lp2)

This function Unikey_find work
Code:
Global.l p11=1234,p12=1234
retcode= UniKey_User_Logon(@handle, @p11,@p12)

This function Unikey_User_Logon return a bad control indicating wrong password
here is it's defintition in the h.file
long UniKey_User_Logon(WORD* pHandle, WORD* pPassword1, WORD* pPassword2)

Code:
Debug retcode
EndIf
Retcode=  UniKey_Logoff(@handle)


This function work

Can someone help me

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/