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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with vfpconnection library 1

Status
Not open for further replies.

Bryan - Gendev

Programmer
Jan 9, 2011
408
0
16
AU
I am using vfpconnect.fll to get a file from my server using HTTPGET from the vfp connection library and want to implement a progress indicator.

Using the prg included with the fll I have

<code>


***********************
FUNCTION MyProgress() && Callback from the FLL - can be used to track operation progress
***********************
*!* You can create your own function, procedure or method to handle this and name it whatever you want.
*!* The nConnectTotalBytes and nConnectBytesSoFar are private variables created on-the-fly by the FLL
?m.nConnectTotalBytes
?m.nConnectBytesSoFar
ENDFUNC
</code>

Using the code as it stands my app can't find the 2 variables.

How can I access them please?
Is there a code snippet anywhere that implements this?

Many thanks

GenDev
 
GedDev,

What is VFPConnect.FLL? Where does MyProgress() come from? Is this your own code, or did you paste it from somewhere?

It's hard to answer this kind of question without any idea of what it's all about.

Mike



__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
Mike,

Sorry - I thought it was well known .. it's from Craig Boyd


The code given is from his sample code.

The downloading works I would like to show my users some progress information.

I need some clues to progress further

GenDev
 
Th documentation says (can be found at
When the cProgressCallback is called 2 variables (nConnectTotalBytes and nConnectBytesSoFar) are created dynamically by the FLL.

Either this does not work out, or you have a typo and access the wrong variables.

It's an unusul approach by the FLL to create variables instead of simply passing in 2 parameters into the callback function. But only Craig can help you with this. The machnism to create these variable might only work that way, if your VFP version is the same as the runtime version needed for the FLL to work, eg VFP9 runtimes.

You could do LIST MEMORY and see, if you find those two variables or some similar variables defined within the progress method.

Bye, Olaf.
 
Are you passing the name of your function in quotes? If not, you need to. It should be something like:

HTTPGet(url, file, "MyProgress()")

Without the quotes, you're calling MyProgress immediately and those two variables don't exist yet.

Doug
 
It worked for me by set procedure command
Code:
SET PROCEDURE TO  vfpconnectiontests.prg ADDITIVE
SET LIBRARY TO (LOCFILE("vfpconnection.fll","FLL"))
?httpget('[URL unfurl="true"]http://www.google.com','google.htm',"MyProgress()",[/URL] "MyTrace()")
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top