Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

.dll doesn't seem to work; what am I doing wrong?

Status
Not open for further replies.

greggb

Programmer
Dec 6, 2003
30
US
I am a novice VFP scripter. I am trying to use a little .dll that overlays data on PDF's but I cannot get it to work - I have searched tirelessly through the posts on this site.

Here is the code I am using:

DECLARE LONG UnlockKey in iSED.dll STRING @ RegKey
DECLARE LONG LoadFromFile in iSED.dll STRING loadname
DECLARE LONG SelectPage in iSed.dll LONG 1
DECLARE LONG DrawText in iSED.dll DOUBLE Xpos, DOUBLE Ypos, LONG text
DECLARE LONG SaveToFile in iSed.dll STRING filename
DECLARE LONG RemoveDocument IN iSED.dll

Can anyone see if I am doing something wrong?

 
This declare looks weird:
DECLARE LONG SelectPage in iSed.dll LONG 1

What is the "1" there for?

Also, DLL functions can be declared any way you can imagine... the error doesn't happen till they're called (whether the error "blows up" or simply does the wrong thing because of nonsensical parameters).

Can you post the documentation to the functions, and a sample of your code calling the functions?

- Bill

Get the best answers to your questions -- See FAQ481-4875.
 
I think that is the problem. How do I "call" the functions? I have just been running this code just like it is - nothing happens. I don't know how to check for error message responses from the program.
 
A command like:
DECLARE LONG LoadFromFile in iSED.dll STRING loadname

creates a "connection" (a declaration) between a VFP function called "loadfromfile" and the actual LoadFromFile Win32 code in the ISED.DLL file.

You can then use it like this:
Code:
lnResult = LoadFromFile( "C:\Mydir\MyFile.ext" )
IF lnResult>0
  messagebox("LoadFromFile seemed to work!")
ENDIF

Of course, the actual values returned depend on how the function was written. It's common for 0 to mean error... but it's also common for 0 to mean OK, and -1 to mean Error...

You can pretty well guess what the functions do by name, but only so far...

BTW: Where did you get this DLL? Is it free? I'd like the same capabilities.... (of writing on a PDF)

- Bill

Get the best answers to your questions -- See FAQ481-4875.
 
Greg,
Before you try these more difficult DLL calls, prehaps a simple example to start with.
Code:
DECLARE INTEGER Beep IN kernel32 INTEGER dwFreq, INTEGER dwDur 

= Beep(100, 90)
Next go to for many more examples. While there is access to many functions for free, you'll need to subscribe to get the full benefit of this site.

Rick
 
Thanks, I think I am getting somewhere by looking at all these examples etc.

Now it says that that it cannot find the entry point LoadFromFile in the DLL what does this mean?

Here is the code I am using:

DECLARE LONG LoadFromFile in iSED.dll STRING filename
= LoadFromFile("c:\sedtech\front.pdf")

Thanks.

BTW - this is a very POWERFUL little DLL (if I ever get it working); not free but well worth it - go to
 
greggb

These calls look to be a GDI+ wrapper DLL. I am correct in assuming this?

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
greggb

I don't know. What is a GDI+ wrapper DLL?

Sorry, are you manipulationg pictures?

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Looking at this page:
It seems that iSED.DLL is not a simple DLL, but rather an ActiveX automation server.

Use it like this:

Click Start, Run:
Type: REGSVR32 c:\path\ised.dll
(replacing "c:\path\" with the full path to wherever ised.dll is located)

in VFP:
Code:
QP = CreateObject('iSED.QuickPDF')
  QP.UnlockKey('type your license key here')
  QP.LoadFromFile("c:\sedtech\front.pdf")
  QP.DrawText(100, 500, 'Hello World!')
  QP.SaveToFile('c:\test.pdf')
  RELEASE QP

- Bill

Get the best answers to your questions -- See FAQ481-4875.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top