#include wconnect.h
DO wwHttp
LOCAL loHttp as wwHttp OF wwhttp.prg
loHttp = CREATEOBJECT("wwHttp")
lcHtml = loHttp.Get("https://microsoft.com")
? lcHtml
I'm running this from the root folder where wwclient 6.22.0 sits. Using the default config.fpw that is in that folder containing SCREEN=ON TITLE=West Wind Client Tools 6.22 EXCLUSIVE=OFF CENTURY=ON STRICTDATE=0 MEMOWIDTH=150 _vfpstart= PATH= .\classes;.\tools;.\console;.\wwipstuff_samples;.\wwipstuff_samples\wwdotnetbridge;
So everything is in the current default folder and path is set to find anything it could possibly need. As soon as I try to create the http object "loHttp = CREATEOBJECT("wwHttp")" The error about the Variable wwversion_number not found in wwhttp.prg on this line of code "cversion = TRANSFORM(WWVERSION_NUMBER)"

wconnect.h
has to be in your FoxPro path when you are compiling or running your code inside of the IDE.
+++ Rick ---
That's in the default folder I'm running the program from and foxpro default folder. I'm pretty sure the current folder is by default in the path fox kooks for files.
If that line is not compiling wconnect.h
, it is not being included. Double check and make sure. Do FULLPATH("wconnect.h")
from your start folder and make sure it's found and returns a valid path and then explicitly recompile the file.
lcFile = FULLPATH("wconnect.h")
? lcFile
? FILE(lcFile) && should be .t.
compile wwhttp.prg && should show no errors
+++ Rick ---

Thanks for the replies, yes it's .t.
#include H:\FoxPro\wwclient-6.22.0\wconnect.h
DO H:\FoxPro\wwclient-6.22.0\classes\wwhttp
LOCAL loHttp as wwHttp OF wwhttp.prg
loHttp = CREATEOBJECT("wwHttp")
lcHtml = loHttp.Get("https://microsoft.com")
? lcHtmlwwHttp
LOCAL loHttp as wwHttp OF wwhttp.prg
loHttp = CREATEOBJECT("wwHttp")
lcHtml = loHttp.Get("https://microsoft.com")
? lcHtml
I have changed the program and specified the exact path, still the same error.
Are you absolutely sure that you have re-compiled the files?
No I'm not! Actually I did run a compile command, however sometimes Fox just does not do it unless you delete the FXP. I did that and boom got it working. Thank you!
Look in your wwHTTP.prg file and see how it references wconnect.h - it should be done on the first line as..
#INCLUDE "wconnect.h"
It's wwHTTP.prg that needs to 'include' the .h file, not necessarily your test.prg file.
You don't want to have to specify a path to wconnect.h within any of the ww*.prg files - the appropriate .h file should be available through the VFP path.
Mike McDonald
The issue isn't running your program - the issue is that when you compiled wwHttp.prg wconnect.h
was perhaps not available. That's why I asked you to recompile the PRG explicitly...
Dependent on your SET DEVELOPMENT
setting .prg
files can autocompile or not after changes and re-running the prg. If you run an EXE or APP you have to recompile every time.
Compile should always do something - either it works, or you get an error and a <compiledFile>.err
that contains the error message. Status bar should show an error or success message on compilation with set notify on
.
+++ Rick ---
Thanks everyone, learned something new. I usually have no problems using these, something was not quite right. Above Mike mentioned my code did not need the include command and wwHTTP.prg is where the include should be. I removed it from my program and sure enough it's working fine. In the end for whatever reason deleting the FXPs and issuing a compile wwhttp, compile wconnect.h (probably did not need to do this one) got things working.