Problem with library

Linux specific forum
loulou2522
Enthusiast
Enthusiast
Posts: 495
Joined: Tue Oct 14, 2014 12:09 pm

Problem with library

Post by loulou2522 »

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: Select all

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) 

User avatar
Mijikai
Addict
Addict
Posts: 1360
Joined: Sun Sep 11, 2016 2:17 pm

Re: Problem with library

Post by Mijikai »

Code: Select all

Prototype.l ProtoUniKey_Find(*pHandle,*pSetting1,*pSetting2)
loulou2522
Enthusiast
Enthusiast
Posts: 495
Joined: Tue Oct 14, 2014 12:09 pm

Re: Problem with library

Post by loulou2522 »

Code: Select all

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: Select all

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: Select all

Debug retcode 
EndIf
Retcode=  UniKey_Logoff(@handle)

This function work

Can someone help me
Post Reply