Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Incorporating DLL File in VFP program
Message
From
19/12/2013 10:39:33
 
 
To
19/12/2013 10:20:52
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01590624
Message ID:
01590637
Views:
89
Note that API calls are case sensitive! Try id=apCreate()

>Sir, it gave an Error at
>
>id=apcreate(). The error is Can not find entry point apCreate in the DLL.
>
>Can you please look at it.
>
>Regards
>
>
>
>>This is VFP version of VB code.
>>I removed events (button click)
>>
>>Declare INTEGER apCreate   IN ps2pdf.dll
>>Declare         apClose   IN ps2pdf.dll INTEGER id
>>Declare INTEGER apConvert IN ps2pdf.dll INTEGER id
>>Declare INTEGER apSetFunc IN ps2pdf.dll INTEGER id, INTEGER code, INTEGER nOptVal1, INTEGER nOptVal2, STRING pOptVal1, STRING pOptVal2
>>Declare INTEGER apGetFunc IN ps2pdf.dll INTEGER id, INTEGER code, INTEGER nOptVal1, INTEGER nOptVal2, STRING pOptVal1, STRING pOptVal2
>>
>>
>>#define AP_Set_Output     3000
>>#define AP_Set_Input      3001
>>#define AP_Set_PDFInfo    3006
>>#define AP_Set_PDFEncrypt 3007
>>
>>
>>*Supported pdf header information
>>#define AP_PDF_TITLE       "title"
>>#define AP_PDF_SUBJECT     "subject"
>>#define AP_PDF_AUTHOR      "author"
>>#define AP_PDF_KEYWORDS    "keywords"
>>#define AP_PDF_APPLICATION "creator"
>>
>>
>>*Supported encryption mode
>>#define AP_PDF_ENCRYPT_40   40
>>#define AP_PDF_ENCRYPT_128 128
>>
>>*Supported user access permissions
>>#define AP_PDF_PERMISSION_NONE     0
>>#define AP_PDF_PERMISSION_PRINT    1
>>#define AP_PDF_PERMISSION_COPYING  2
>>#define AP_PDF_PERMISSION_MODIFY   4
>>#define AP_PDF_PERMISSION_ALL      7
>>
>>
>>** Convert ps files to a general pdf file.
>>id = apCreate()
>>IF (id # 0)
>>   apSetFunc(id, AP_Set_Input , 0, 0, "test1.ps" , 0)  &&input file.
>>   apSetFunc(id, AP_Set_Input , 0, 0, "test2.ps" , 0)  &&input file.
>>   apSetFunc id, AP_Set_Output, 0, 0, "test1.pdf", 0) &&output format and file.
>>    
>>   apSetFunc(id, AP_Set_PDFInfo, 0, 0, AP_PDF_TITLE      , "untitled document")
>>   apSetFunc(id, AP_Set_PDFInfo, 0, 0, AP_PDF_AUTHOR     , "adultpdf")
>>   apSetFunc(id, AP_Set_PDFInfo, 0, 0, AP_PDF_APPLICATION, "PS to PDF sdk demo")
>>   iRet = apConvert(id)
>>   apClose(id)
>>ENDIF
>>
>>
>>* Convert ps files to an restricted pdf file.
>>sUserPw  = "1111"
>>sOwnerPw = "2222"
>>    
>>id = apCreate()
>>IF (id # 0)
>>   apSetFunc(id, AP_Set_Input , 0, 0, "test1.ps" , 0)  &&input file.
>>   apSetFunc(id, AP_Set_Input , 0, 0, "test2.ps" , 0)  &&input file.
>>   apSetFunc id, AP_Set_Output, 0, 0, "test1.pdf", 0) &&output format and file.
>>    
>>   apSetFunc(id, AP_Set_PDFInfo, 0, 0, AP_PDF_TITLE      , "untitled document")
>>   apSetFunc(id, AP_Set_PDFInfo, 0, 0, AP_PDF_AUTHOR     , "adultpdf")
>>   apSetFunc(id, AP_Set_PDFInfo, 0, 0, AP_PDF_APPLICATION, "PS to PDF sdk demo")
>>        
>>   apSetFunc(id, AP_Set_PDFEncrypt, AP_PDF_ENCRYPT_128, AP_PDF_PERMISSION_PRINT + AP_PDF_PERMISSION_COPYING, sUserPw, sOwnerPw)
>>   
>>   iRet = apConvert(id)
>>   apClose(id)
>>ENDIF
>>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform