Testing Debenu Quick PDF Library

Testing Debenu Quick PDF Library

Postby Klaas den Dekker » Fri Jan 09, 2015 12:44 pm

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
Klaas den Dekker
 
Posts: 23
Joined: Sat Oct 22, 2005 8:22 pm

Re: Testing Debenu Quick PDF Library

Postby Antonio Linares » Fri Jan 09, 2015 4:26 pm

Klaas,

What FWH version are you using ?

Are you using Harbour or xHarbour ? Borland ?

thanks
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42122
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Testing Debenu Quick PDF Library

Postby Klaas den Dekker » Fri Jan 09, 2015 11:50 pm

xHarbour 1.2.1 rev. 9421
Borland 5.82
Klaas den Dekker
 
Posts: 23
Joined: Sat Oct 22, 2005 8:22 pm

Re: Testing Debenu Quick PDF Library

Postby Antonio Linares » Sat Jan 10, 2015 3:35 am

Klaas,

What FWH version are you using ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42122
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Testing Debenu Quick PDF Library

Postby Klaas den Dekker » Sat Jan 10, 2015 9:19 am

FWHX 12.07
Klaas den Dekker
 
Posts: 23
Joined: Sat Oct 22, 2005 8:22 pm

Re: Testing Debenu Quick PDF Library

Postby Antonio Linares » Sat Jan 10, 2015 3:09 pm

Klaas,

How are you initially setting the value of hDLL ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42122
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Testing Debenu Quick PDF Library

Postby Klaas den Dekker » Sun Jan 11, 2015 9:05 am

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
Klaas den Dekker
 
Posts: 23
Joined: Sat Oct 22, 2005 8:22 pm

Re: Testing Debenu Quick PDF Library

Postby Antonio Linares » Sun Jan 11, 2015 9:12 am

Klaas,

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

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42122
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Testing Debenu Quick PDF Library

Postby carlos vargas » Mon Jan 12, 2015 2:51 am

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/owncloud/public.php?service=files&t=142cfb573fa6be27b35ec8ec7252fb8d

Code: Select all  Expand view  RUN

#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
*/

 
Salu2
Carlos Vargas
Desde Managua, Nicaragua (CA)
User avatar
carlos vargas
 
Posts: 1721
Joined: Tue Oct 11, 2005 5:01 pm
Location: Nicaragua

Re: Testing Debenu Quick PDF Library

Postby carlos vargas » Mon Jan 12, 2015 3:35 am

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  Expand view  RUN
#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
*/

 
Salu2
Carlos Vargas
Desde Managua, Nicaragua (CA)
User avatar
carlos vargas
 
Posts: 1721
Joined: Tue Oct 11, 2005 5:01 pm
Location: Nicaragua

Re: Testing Debenu Quick PDF Library

Postby carlos vargas » Mon Jan 12, 2015 3:43 am

ya acepta la licencia, crea el archivo, pero no imprime nada.
Code: Select all  Expand view  RUN
#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
*/
Salu2
Carlos Vargas
Desde Managua, Nicaragua (CA)
User avatar
carlos vargas
 
Posts: 1721
Joined: Tue Oct 11, 2005 5:01 pm
Location: Nicaragua

Re: Testing Debenu Quick PDF Library

Postby Antonio Linares » Mon Jan 12, 2015 1:04 pm

Carlos,

Code: Select all  Expand view  RUN
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!
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42122
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Testing Debenu Quick PDF Library

Postby Klaas den Dekker » Mon Jan 12, 2015 2:47 pm

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
Klaas den Dekker
 
Posts: 23
Joined: Sat Oct 22, 2005 8:22 pm

Re: Testing Debenu Quick PDF Library

Postby nageswaragunupudi » Mon Jan 12, 2015 3:42 pm

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 ?
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10656
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Testing Debenu Quick PDF Library

Postby Antonio Linares » Mon Jan 12, 2015 4:36 pm

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 :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42122
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 18 guests