Page 1 of 3

Testing Debenu Quick PDF Library

Posted: Fri Jan 09, 2015 12:44 pm
by Klaas den Dekker
Hi,
I'm testing the Debenu Quick PDF Library with Fivewin + xHarbour but I'm having problems starting up.
I use:
cLicense := "jx4aq86h5ou5mk9i86644936y"
xId := DllCall( hDLL,nil,"DPLCreateLibrary" )
xVal := DllCall( hDLL,nil,"DPLUnlockKey",xId,StrPtr(cLicense) )
DllCall( hDLL,nil,"DPLReleaseLibrary",xId )

XId return a value (f.i. 83652944) but xVal allways return 0, what means that the library is not correct unlocked.
The problem according to the helpdesk of Debenu is that the string cLicense is not correcty parsed to the function.
I also tried:
xVal := DllCall( hDLL,nil,"DPLUnlockKey",xId,cLicense )

Can anyone help me?
Does anyone use the Debenu Quick PDF Library?

best regards,
Klaas den Dekker

Re: Testing Debenu Quick PDF Library

Posted: Fri Jan 09, 2015 4:26 pm
by Antonio Linares
Klaas,

What FWH version are you using ?

Are you using Harbour or xHarbour ? Borland ?

thanks

Re: Testing Debenu Quick PDF Library

Posted: Fri Jan 09, 2015 11:50 pm
by Klaas den Dekker
xHarbour 1.2.1 rev. 9421
Borland 5.82

Re: Testing Debenu Quick PDF Library

Posted: Sat Jan 10, 2015 3:35 am
by Antonio Linares
Klaas,

What FWH version are you using ?

Re: Testing Debenu Quick PDF Library

Posted: Sat Jan 10, 2015 9:19 am
by Klaas den Dekker
FWHX 12.07

Re: Testing Debenu Quick PDF Library

Posted: Sat Jan 10, 2015 3:09 pm
by Antonio Linares
Klaas,

How are you initially setting the value of hDLL ?

Re: Testing Debenu Quick PDF Library

Posted: Sun Jan 11, 2015 9:05 am
by Klaas den Dekker
Yes, I am:

STATIC hDLL

IF DebLoadDLL()
cLicense := "jx4aq86h5ou5mk9i86644936y"
xId := DllCall( hDLL,nil,"DPLCreateLibrary" )
xRet := DllCall( hDLL,nil,"DPLUnlockKey",StrPtr(cLicense) )
DllCall( hDLL,nil,"DPLReleaseLibrary",xId )
ENDIF
....


** Load Debenu lib
FUNCTION DebLoadDLL()
LOCAL lResult := .T.
hDLL := LOADLIBRARY( GsExeDir()+"\"+DLLfile )
IF ABS( hDLL ) <= 32
lResult := .F.
ENDIF
RETURN lResult

Re: Testing Debenu Quick PDF Library

Posted: Sun Jan 11, 2015 9:12 am
by Antonio Linares
Klaas,

Could you please email me the DLL in a ZIP file renamed as ZOP ? thanks

Re: Testing Debenu Quick PDF Library

Posted: Mon Jan 12, 2015 2:51 am
by carlos vargas
no he podido registrar la clave de la licencia, aun la DEMO :-) antonio, nUnlock siempre vale 0, probado con xharbour, modo consola.

http://castillolawyers.no-ip.info/owncl ... ec7252fb8d

Code: Select all

#define DC_CALL_CDECL          0x0010 
#define DC_CALL_STD            0x0020

/*--------------------------------------------------------------*/

STATIC hDLL

/*--------------------------------------------------------------*/

PROCEDURE Main()
   LOCAL nInstanceID
   LOCAL nUnlock
   
   PRIVATE cDllFile := "d:\compiler\t\DebenuPDFLibraryDLL1113.Dll"
   PRIVATE cLicense1 := "jk7o53he84n6bo9np5cj9yb8y"
   PRIVATE cLicense2 := "jx4aq86h5ou5mk9i86644936y"
   
   cls
   ?
   ?"File exist:",File( cDllFile )
   ?"License Key", cLicense1
   ?
   
   IF DebLoadDLL()
      nInstanceID := DllCall( hDLL, DC_CALL_STD, "DPLCreateLibrary" )
      ?"InstanceID.:", nInstanceID
      IF !HB_IsNIL( nInstanceID )
         nUnlock := DllCall( hDLL, DC_CALL_STD, "DPLUnlockKey", nInstanceID, cLicense1 )
         ?"Unlock:", nUnlock 
         IF nUnlock==1
            ?"File created:"
            DllCall( hDLL, DC_CALL_STD, "DPLDrawText", nInstanceID, 100, 500, "Hello Word!" )
            DllCall( hDLL, DC_CALL_STD, "DPLSaveToFile", nInstanceID, "d:\test.pdf" ) 
         ELSE
            ?"Error unlock:", GetLastError()
         ENDIF
         DllCall( hDLL, DC_CALL_STD, "DPLReleaseLibrary", nInstanceID )
      ELSE
         ?"Error instance:", GetLastError()
      ENDIF
   ENDIF
   
   DebUnLoadDLL()
   
RETURN

/*--------------------------------------------------------------*/

FUNCTION DebLoadDLL()
   LOCAL lResult := .T.
   
   hDLL := LoadLibrary( cDllFile )

   IF Abs( hDLL ) <= 32
      lResult := .F. 
   ENDIF
   
   ?"Dll loaded.:", lResult
   ?"hDLL.......:", hDll
   
RETURN lResult

/*--------------------------------------------------------------*/

FUNCTION DebUnLoadDLL()
    
   IF Abs( hDLL ) <= 32
      FreeLibrary( hDLL )
   ENDIF
   
RETURN

/*--------------------------------------------------------------*/

/*
  int InstanceID;
  InstanceID = DPLCreateLibrary();
  if (DPLUnlockKey(InstanceID, “your license key”) == 1) {
    DPLDrawText(InstanceID, 100, 500, “Hello world”);
    DPLSaveToFile(InstanceID, “C:\Docs\HelloFromDLL.pdf”);
  }
  DPLReleaseLibrary(InstanceID);
  
*/

/*
IF DebLoadDLL()
cLicense := "jx4aq86h5ou5mk9i86644936y"
xId := DllCall( hDLL,nil,"DPLCreateLibrary" )
xRet := DllCall( hDLL,nil,"DPLUnlockKey",StrPtr(cLicense) )
DllCall( hDLL,nil,"DPLReleaseLibrary",xId )
ENDIF
*/
 

Re: Testing Debenu Quick PDF Library

Posted: Mon Jan 12, 2015 3:35 am
by carlos vargas
codigo tanto para xharbour como para harbour, ahora no me muestra ningun texto, ademas que la funcion DPLUnlockKey no funciona aun, pero si DPLUnlockKeyA

Code: Select all

#define DC_CALL_CDECL          0x0010 
#define DC_CALL_STD            0x0020

/*--------------------------------------------------------------*/

STATIC hDLL

/*--------------------------------------------------------------*/

PROCEDURE Main()
   LOCAL nInstanceID
   LOCAL nUnlock
   
   PRIVATE cDllFile := "d:\compiler\t\DebenuPDFLibraryDLL1113.Dll"
   PRIVATE cLicense1 := "jk7o53he84n6bo9np5cj9yb8y"
   PRIVATE cLicense2 := "jx4aq86h5ou5mk9i86644936y"
   
   cls
   ?
   ?"File exist:",File( cDllFile )
   ?"License Key", cLicense1
   ?
   
   IF DebLoadDLL()
      nInstanceID := DllCall( hDLL, DC_CALL_STD, "DPLCreateLibrary" )
      ?"InstanceID.:", nInstanceID
      IF !HB_IsNIL( nInstanceID )
         nUnlock := DllCall( hDLL, DC_CALL_STD, "DPLUnlockKeyA", nInstanceID, cLicense1 ) //No funciona DPLUnlockKey
         ?"Unlock:", nUnlock 
         IF nUnlock==1
            ?"File created:"
            DllCall( hDLL, DC_CALL_STD, "DPLDrawText", nInstanceID, 10, 10, AnsiToWide("Hello Word!") ) //Esto no funciona
            DllCall( hDLL, DC_CALL_STD, "DPLSaveToFile", nInstanceID, AnsiToWide("d:\test.pdf") ) 
         ELSE
            ?"Error unlock:", GetLastError()
         ENDIF
         DllCall( hDLL, DC_CALL_STD, "DPLReleaseLibrary", nInstanceID )
      ELSE
         ?"Error instance:", GetLastError()
      ENDIF
   ENDIF
   
   DebUnLoadDLL()
   
RETURN

/*--------------------------------------------------------------*/

FUNCTION DebLoadDLL()
   LOCAL lResult := .T.
   
   hDLL := LoadLibrary( cDllFile )

   #ifdef __XHARBOUR__
   IF Abs( hDLL ) <= 32
   #else
   IF empty(hDll)
   #endif   
      lResult := .F. 
   ENDIF
   
   ?"Dll loaded.:", lResult
   ?"hDLL.......:", hDll
   
RETURN lResult

/*--------------------------------------------------------------*/

FUNCTION DebUnLoadDLL()
   
   #ifdef __XHARBOUR__
   IF Abs( hDLL ) <= 32
   #else
   IF !empty(hDll)
   #endif   
      FreeLibrary( hDLL )
   ENDIF
   
RETURN

/*--------------------------------------------------------------*/
#ifdef __HARBOUR__
#ifndef __XHARBOUR__
function FreeLibrary(hDll)
return DllUnload(hDll)  
function LoadLibrary(cDll)
return DllLoad(cDll)
function GetLastError()
return WAPI_GETLASTERROR()     
#endif
#endif

/*
  int InstanceID;
  InstanceID = DPLCreateLibrary();
  if (DPLUnlockKey(InstanceID, “your license key”) == 1) {
    DPLDrawText(InstanceID, 100, 500, “Hello world”);
    DPLSaveToFile(InstanceID, “C:\Docs\HelloFromDLL.pdf”);
  }
  DPLReleaseLibrary(InstanceID);
  
*/

/*
IF DebLoadDLL()
cLicense := "jx4aq86h5ou5mk9i86644936y"
xId := DllCall( hDLL,nil,"DPLCreateLibrary" )
xRet := DllCall( hDLL,nil,"DPLUnlockKey",StrPtr(cLicense) )
DllCall( hDLL,nil,"DPLReleaseLibrary",xId )
ENDIF
*/
 

Re: Testing Debenu Quick PDF Library

Posted: Mon Jan 12, 2015 3:43 am
by carlos vargas
ya acepta la licencia, crea el archivo, pero no imprime nada.

Code: Select all

#define DC_CALL_CDECL          0x0010 
#define DC_CALL_STD            0x0020

/*--------------------------------------------------------------*/

STATIC hDLL

/*--------------------------------------------------------------*/

PROCEDURE Main()
   LOCAL nInstanceID
   LOCAL nUnlock
   
   PRIVATE cDllFile := "d:\compiler\t\DebenuPDFLibraryDLL1113.Dll"
   PRIVATE cLicense1 := "jk7o53he84n6bo9np5cj9yb8y"
   PRIVATE cLicense2 := "jx4aq86h5ou5mk9i86644936y"
   
   cls
   ?
   ?"File exist:",File( cDllFile )
   ?"License Key", cLicense1
   ?
   
   IF DebLoadDLL()
      nInstanceID := DllCall( hDLL, DC_CALL_STD, "DPLCreateLibrary" )
      ?"InstanceID.: ", nInstanceID
      IF !HB_IsNIL( nInstanceID )
         nUnlock := DllCall( hDLL, DC_CALL_STD, "DPLUnlockKey", nInstanceID, AnsiToWide(cLicense1) )
         ?"Unlock: ", nUnlock 
         IF nUnlock==1
            ?"File created: "
            DllCall( hDLL, DC_CALL_STD, "DPLDrawText", nInstanceID, 100, 100, AnsiToWide("Hello Word!") ) //Esto no funciona
            DllCall( hDLL, DC_CALL_STD, "DPLSaveToFile", nInstanceID, AnsiToWide("d:\test1.pdf") ) 
         ELSE
            ?"Error unlock: ", GetLastError()
         ENDIF
         DllCall( hDLL, DC_CALL_STD, "DPLReleaseLibrary", nInstanceID )
      ELSE
         ?"Error instance: ", GetLastError()
      ENDIF
   ENDIF
   
   DebUnLoadDLL()
   
RETURN

/*--------------------------------------------------------------*/

FUNCTION DebLoadDLL()
   LOCAL lResult := .T.
   
   hDLL := LoadLibrary( cDllFile )

   #ifdef __XHARBOUR__
   IF Abs( hDLL ) <= 32
   #else
   IF empty(hDll)
   #endif   
      lResult := .F. 
   ENDIF
   
   ?"Dll loaded.:", lResult
   ?"hDLL.......:", hDll
   
RETURN lResult

/*--------------------------------------------------------------*/

FUNCTION DebUnLoadDLL()
   
   #ifdef __XHARBOUR__
   IF hDLL <> 0
   #else
   IF !empty(hDll)
   #endif   
      FreeLibrary( hDLL )
   ENDIF
   
RETURN

/*--------------------------------------------------------------*/
#ifdef __HARBOUR__
#ifndef __XHARBOUR__
function FreeLibrary(hDll)
return DllUnload(hDll)  
function LoadLibrary(cDll)
return DllLoad(cDll)
function GetLastError()
return WAPI_GETLASTERROR()     
#endif
#endif

/*
  int InstanceID;
  InstanceID = DPLCreateLibrary();
  if (DPLUnlockKey(InstanceID, “your license key”) == 1) {
    DPLDrawText(InstanceID, 100, 500, “Hello world”);
    DPLSaveToFile(InstanceID, “C:\Docs\HelloFromDLL.pdf”);
  }
  DPLReleaseLibrary(InstanceID);
  
*/

/*
IF DebLoadDLL()
cLicense := "jx4aq86h5ou5mk9i86644936y"
xId := DllCall( hDLL,nil,"DPLCreateLibrary" )
xRet := DllCall( hDLL,nil,"DPLUnlockKey",StrPtr(cLicense) )
DllCall( hDLL,nil,"DPLReleaseLibrary",xId )
ENDIF
*/

Re: Testing Debenu Quick PDF Library

Posted: Mon Jan 12, 2015 1:04 pm
by Antonio Linares
Carlos,

Code: Select all

nUnlock := DllCall( hDLL, DC_CALL_STD, "DPLUnlockKey", nInstanceID, AnsiToWide(cLicense1) )
Excellent! :-)

We did not considered this possibility, that a wide string was expected. Very good!

Re: Testing Debenu Quick PDF Library

Posted: Mon Jan 12, 2015 2:47 pm
by Klaas den Dekker
Hi Antonio and Carlos,

Indeed, DPLUnlockKeyA works, thanks very much!

nUnlock := DllCall( hDLL, DC_CALL_STD, "DPLUnlockKeyA", nInstanceID, cLicenseUSD ) -> this works
nUnlock := DllCall( hDLL, DC_CALL_STD, "DPLUnlockKey", nInstanceID, AnsiToWide(cLicenseUSD) ) -> this does not work

Now I can continue with the conversion of EMF to PDF with this lib.

Best regards,
Klaas den Dekker

Re: Testing Debenu Quick PDF Library

Posted: Mon Jan 12, 2015 3:42 pm
by nageswaragunupudi
Now I can continue with the conversion of EMF to PDF with this lib.
Does the library provide for direct conversion of EMF to PDF ?

Re: Testing Debenu Quick PDF Library

Posted: Mon Jan 12, 2015 4:36 pm
by Antonio Linares
Klaas,
nUnlock := DllCall( hDLL, DC_CALL_STD, "DPLUnlockKeyA", nInstanceID, cLicenseUSD ) -> this works
That seems the right one as usually "A" stands for Ansi and "W" for wide. Thats the way Microsoft uses to name the Windows API functions.

A very good finding from Carlos, as we did not considered that possibility :-)