#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
*/
#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
*/
#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
*/
nUnlock := DllCall( hDLL, DC_CALL_STD, "DPLUnlockKey", nInstanceID, AnsiToWide(cLicense1) )
Now I can continue with the conversion of EMF to PDF with this lib.
nUnlock := DllCall( hDLL, DC_CALL_STD, "DPLUnlockKeyA", nInstanceID, cLicenseUSD ) -> this works
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 34 guests