Rick Strahl's FoxPro and Web Connection Web Log
White Papers | Products | Message Board | News |

Last 50 comments

re: Web Connection and TLS 1.2 Support

Rick Strahl
@Darko - if you're going to use an EXE maybe you should just shell out and use `curl` instead. It has a lot of capabilities and it too can work just fine without the Windows TLS stack and it's a well known interface that works for all sorts of things beyond just HTTP.

re: Using CreateProcess API instead of the FoxPro ! RUN command


Sorry I forgot to mention that I'm running a VFP compiled exe with createprocess()


re: Using CreateProcess API instead of the FoxPro ! RUN command


I can get start a process using createprocess() but the lhProcess number is different to the PID listed in the TaskManager.

So when I use OpenProcess(PROCESS_QUERY_INFORMATION+PROCESS_VM_READ,0,lhProcess) it fails to open the handle.

Is there a way to get the correct pid back or is enumerating all the processes the only way to go?


re: Startup Error Tracing in West Wind Web Conection 6


re: Web Connection and TLS 1.2 Support

Darko Kezic
Hi, thanks for sharing this.

I used in my various VFP applications directly Windows AJAX with
and was biten with TLS 1.2 issue on various client PCs.

At the end, I created small EXE with Golang which only connects to server and returns result. Then I called this EXE instead of MSXML2.ServerXMLHTTP with
l_oShell = CREATEOBJECT("Wscript.Shell") ...

Yes, it looks silly to call another EXE for every HTTP request, but this was only secure way to do it on older Windows.

re: Custom Manifest Files in Visual FoxPro EXEs

Hi Rick,

Do you know if you have to put all the interfaces contained in a active-x dll into the manifest or just the ones you want to call?



re: Visual FoxPro and Multi-Threading

Thank you Rick you a legend. FoxPro is so good with handling data it will be hard to find an alternative in the future unless someone reinvents it in a multithreaded form. Hopefully we can keep it going for another 20yrs or so. There is still Cobol Code out there that is 58yrs old and still running.

re: Web Connection and TLS 1.2 Support

Thanks, Rick--great information, as always!

re: Web Connection and TLS 1.2 Support

Rick - discovered a few minutes ago that another issue when trying to resolve this is the default settings for IE Enhanced Security Settings Configuration. If these are both active you will not be able to open this url https://api.authorize.net/xml/v1/request.api if you are running Windows 2012 R2. If you deactivate for both administrators and users the page will open.

working in Internet Explorer Automation from FoxPro

hi, can you tell me how to move internet explorer to the top level ?

re: Calling JSON REST Services with FoxPro and wwJsonServiceClient

Hi Rick,

I'm trying to figure out how to use wwJsonServiceClient to generate an OAUTH 2.0 signature.

Their API docs have an example:
The signature is sent in a header named BDXAPI_NAME.


re: FoxPro EXE DCOM Configuration on 64 Bit Systems


Did you ever find a resolve for this? We are migrating our website over to a new Windows 2012 Server and are not able to get the foxpro dlls to work even when we have registered them successfully?


re: Calling JSON REST Services with FoxPro and wwJsonServiceClient

Here's more info in the help file:


re: Calling JSON REST Services with FoxPro and wwJsonServiceClient

Yes you can call `CreatewwHttp()` which returns a wwHttp instance once which you can set any wwHttp settings. That instance is then used in the request:

<script lang="vfp">
oProxy = CREATEOBJECT("wwJsonServiceClient")

*** Create custom Http Object for Authentication
loHttp = CREATEOBJECT("wwHttp")
loHttp.cUsername = "ricks"
loHttp.cPassword = "seekrit22"

*** Pass it to the proxy to use

loArtist = loProxy.CallService("http://albumviewerswf.west-wind.com/api/artist",loArtist,"PUT")

IF loProxy.lError
? loProxy.cErrorMsg

? loArtist.Albums.Count

re: Calling JSON REST Services with FoxPro and wwJsonServiceClient

I like the idea using the wwJsonServiceClient, however is this also possible with headers? Using HTTP call I would normally so something like that:
loHTTP.AppendHeader("user_session", lcUserSession)
lcHTML = loHTTP.HTTPGet("")

re: West Wind Web Connection 6.17 released

webConnectionConfiguration does not work in webconnectionmodule.dll version Version OK

re: Doing HTTP Headers right in Web Connection 5.0



The .T. parameter makes a permanent redirect.

re: Doing HTTP Headers right in Web Connection 5.0

Very helpful - but how would I return a 301 redirect? In my 5.x app, I do this:
Response.Status = "404 File not found"
Response.Write("Page was not found")


re: UTC Time in FoxPro

I am working on a delivery routing module for my application and I decided to use javascript to pass the users browser time to vfp. I then convert the hex value to a fox datetime() easily. Javascript returns the time in hex starting from 1/1/1970 (aka "epoch time).

lnUnixEpochTime = 1500847437204
? lnUnixEpochTime/(60*60*60*60*60*60) + DATETIME()

This returns: 07/23/2017 05:16:29 PM

re: Persisting Static Objects in Web Connection Applications

Using addproperty() in .Init() works around the COM signature issue.

Also, using state persistence the way you describe applied more to single server applications (logical servers such as COM objects)

re: IIS 7 Default Request Filtering and Web Connection

Hello, i am facing the issue while using request filtering option. My website didn't work until I add '.' in allowed list. I am unable to find which particular extension I am missing.
Thanks in advance.

re: Handling Multiple Screens in Visual FoxPro Desktop Applications

Yes, the _screen.top and _screen.left can obtain value -32000 which is hard to find on any monitor...

This can happen when the main FoxPro window is minimized.

re: How to work around Visual FoxPro's 16 Megabyte String Limit

In other words well, according to me in my opinion Long Path Tool is the best because I am still using it now for more than 3 years & will continue to do so as it is so user friendly, simple to use & you can do anything with it & I would definitely recommend it to everyone out there.

re: How to work around Visual FoxPro's 16 Megabyte String Limit

I have recently used a program called Long Path Tool & i am so happy with the results that this particular program does. I have more than 50 GB of duplicate files in my computer and i was going crazy with the hard disk space that was being consumed and thanks to the "Long Path Tool" where i don't need to search each & every file to delete. Long Path Tool did the job for me within a very short period of time. So no need to google each problem to remove duplicate & unwanted files, just grab the program called Long Path Tool.

Foxpro application

Thank you for your given information.
<a href="www.http://techmaticsys.com/foxpro.html">
Foxpro application</a>.

Visual FoxPro is great for building desktop applications.It is a object-oriented programming to reuse components across applications.Visual FoxPro originated as a member of the class of languages commonly referred to as "xBase" languages,Visual FoxPro is a great tool for building database solutions of all sizes.

re: Clicks not working in Internet Explorer Automation from FoxPro

Thank you, thank you are a genius, i was about to setup a machine with older OS and IE.
oButton.Click(.F.) is a life saver.

re: Calling JSON REST Services with FoxPro and wwJsonServiceClient

Thank you Rick--great stuff as always. And a cool plug for a great band in your example (Accept)!

re: Fixing wwDotnetBridge "Unable to load Clr Instance" Errors

Ian C.
Hi All.

There now exists a command-line tool to unblock these downloaded files. PowerShell has the Unblock-File commandlet.

See http://ss64.com/ps/unblock-file.html

re: Visual Studio Gets Support for FoxPro Files

Richard Kaye
The link for the syntax highlighting extension has some extraneous text at the beginning of the URL, Rick.

re: Visual Studio Gets Support for FoxPro Files

Cetin - this is actually not an official Microsoft language add-in. Mads just built this on his own and FoxPro merely uses the TextMate add in to provide FoxPro support. The individual languages are not supported by this add-in but rather they are re-using existing Textmate add-ins from other tools (in this case Matt Slay's Sublime implementation). That implementation only provides highlighting not auto-complete features.

TextMate syntax supports better autocomplete, but the language file has to be built up to support this. The source code for the plug-in is available so you can contribute to make it better yourself instead of crying about it. Guaranteed nobody at Microsoft is going to do it for us...

re: Visual Studio Gets Support for FoxPro Files

Cetin Basoz
I downloaded and installed the extension in an excitement (besides VFP, I have been using C# and Go and seeing Go there made me more happy initially).
However it is a total disappointment. It doesn't even work as well as VFP's own editor.

Come on Microsoft you could do it better for your own product! Notepad++ is doing that highlighting for years (not surprising after the failure they made announcement "VS on Mac" has turned to be another big disappointment with their ridicilous license aggrement).

Long Path Tool

aiden carter
Thanks for this post,

The Long path tool is the very best program for error, unlock solution.
Try it and solved your problem.
I used the long path tool and I solved my error, unlocks problem solution.

re: Detecting hung Objects in Visual FoxPro

Good grief... Every time I run into a VFP problem, I dig into it enough to think I understand the issues, and when I Google during my research, Rick has already tackled it and explained it well enough to help me finish solving my problem. Again!

I have now added Dispose() method into my base business object class, and my objects can now be cleanly and fully released from memory.

Thanks, Rick!!

re: Detecting hung Objects in Visual FoxPro

Thanks Rick for yet another informative post.
On a similar note, I was looking for a hung object but the memory leak turned out to be a foxpro feature. When foxpro loads an image like with the image control, it keeps the image in memory in case it is needed again. You have to issue [release resources] or [release resource <<filename>>] to free up the memory.


Wow... almost 10 years later and today I was researching slow client app form load times on forms that use 30-40 Business Objects to present data field and grids to the user.

40 BOs were taking 7-8 seconds to new up when the form launched while running in an EXE, but only 1-2 seconds when running the same code from within the VFP IDE.

I blogged about my discovery, research, and remedy. Link below. In the post I also give props to Rick for blogging about this a decade ago.


re: Calling JSON REST Services with FoxPro and wwJsonServiceClient

1) Yes you can return cursor data by using "cursor:TQuery" as a string to specify the cursor in a property. The cursor is turned into an array and sent as JSON. Can be the top level result or set on a property assuming the cursor is open. Cursor serialization is one way - you can't directly deserialize an array into a cursor. You can however use CollectionToCursor() to dump the result object back into a cursor/table as long as the table exists.

2) Memo fields are just text and it just works. Nothing special about memo fields. Binary data is converted base64 and sent.

re: Calling JSON REST Services with FoxPro and wwJsonServiceClient

Hi Rick,

Nice addition in west wind client tools. I have following questions.

1) In VFp, table structure can be passed with cursortoXml. Is it possible with Json services?

2) How memo field data is passed with Json services ?


re: Transparent Bitmaps on Buttons and other Controls

Paul Weisberg
Great article! I found this while searching for a similar problem. One thing I just discovered for myself, is that when you assign a PNG file to the picture property of a control, FoxPro locks the resource file such that it cannot be used in another control and other file methods like fopen() on that picture file will fail. This is not true for BMP files, nor is it true for PNG files that have no transparency. This is obviously some quirk in the way that FoxPro handles transparent PNG files. I expect that the above solutions will work nicely!

re: How to work around Visual FoxPro's 16 Megabyte String Limit

Hi Rick,

Attempted to modify wc6/classes/wwAPI > EncodeDBF() to support files larger than 16Meg, couldn't work it out, any idea why?


re: How to work around Visual FoxPro's 16 Megabyte String Limit

Hi Rick,

Can't find 'oPostStream' and 'cPostStreamClass' in WC6's wwHTTP.
Did you implement these properties somewhere else?


re: Custom Manifest Files in Visual FoxPro EXEs

@Tomas - Exe execution doesn't work with registrationless COM due to the extra DCOM related entries. It only works for DLL servers including OCX files (which are just renamed DLLs).

re: Custom Manifest Files in Visual FoxPro EXEs

Registrationless COM Activation requires that during using vfp exe, dll must be near vfp exe, does not it?

re: UTC Time in FoxPro

Almost any time I have a VFP question or problem, I need look no further than your blog--very helpful, as always. Thanks for continuing to be such a great resource for VFP developers.

re: String Tokenizing based on StrExtract()

It's been real handy to have this function. In Help Builder I dozens of places where this stuff comes in handy. My MarkdownParser class in Web Connection too uses this in a couple of places. It's reduced a few very common use cases to two lines of code.

re: UTC Time in FoxPro

Hi Rick, The code examples are great.. many thanks... but do you know a way of determining the UTC of a particular country on a particular date... I am attempting to write code to calculate the the flight time from one location to another, on a given date, and passing back the correct local time of arrival... Any help would be much appreciated.

re: String Tokenizing based on StrExtract()

Doug Hennig
I have to do this stuff frequently as well, and interestingly, like in your case, it usually involves parsing a comma-delimited list (usually column names, such as in a SQL SELECT statement) where one of the items in the list could contain commas, such as SELECT [This is a dumb column name, right], SomeOtherField ... I pretty much use the same technique (placeholders) but hadn't thought of creating a helper class.

re: Handling Multiple Screens in Visual FoxPro Desktop Applications

My Foxpro disappeared as you had explained but I don't even have a second monitor. Somehow, when I double clicked, it ran with just the icon at the bottom. No matter how I clicked on it, the screen didn't appear then I saw this post. I used Notepad to create a prg file with the following codes and then dragged this prg file to the VFP icon to run. My screen popped back. Wonderful.


re: UTC Time in FoxPro

Paul Gibson
Very good post Rick, totally agree. Even if you don't use datetimes from different geographical timezones it is still relevant if you deal with DST and the pertinence of this goes up every 6 months when systems transition from DST to non-DST. And so it is that I've landed on this page just a few days after the UK has reverted back to GMT from DST and I've hit a couple of little niggles with VFP's inability to natively resolve datetimes correctly.

You are spot on that this is par for the course and almost second nature when coding in .NET so it's frustrating that it is a little awkward in VFP.

I have an exe that was built just over a week ago (20/10/2015) while we were still in DST, it was built at 11:24 AM Local time which would have been 10:24 UTC. I'm ignoring the date-part for brevity because that's not changing due to the UK being so close to UTC and the file being built near midday. Up until Sunday morning VFP reported the time of the file correctly as 11:24 and you could confirm this by looking at the file in Windows Explorer. Since the clocks went back VFP now reports the file's (local) time as 10:24 so any comparisons might assume that the file was changed. Windows Explorer is still showing the time correctly as 11:24 but FDATE() and ADIR() in VFP cannot give me the correct local time now that it's running in the different TimeZone.

This is particular annoying for a routine I wrote which monitors changes in JPEGs. Once of the metrics which it stores to detect if the files have changed is the date modified - obtained via ADIR(). When the routine ran before Sunday it recorded all the Date modifies of all the pertinent files and that was fine but since the clocks changed the routine has scanned the (unchanged) files and the datetimes appear to have all changed when they haven't in reality, it's just VFPs (in)ability to read the correct datetime for files created in a different timezone which is causing a problem. My routine therefore assumed that all the JPEGs had changed since the previous time it scanned them and performed a task it thought was necessary when in fact it wasn't. It'll only hit this problem once every six months because it then records the new datetimes but it's not good for this routine to have this problem at all, let alone a reoccurring one.

The solution, as you say, is to store those datetimes using the UTC standard and potentially have a general rule that any datetime used for comparison purposes be stored in UTC. I'm working in a 16+ year-old application, so it's difficult to retrofit storing ALL datetimes in UTC across the whole system but for new facilities it should be possible.

One thing I thought was interesting in your implementation is that you cache the TimeZone offset for speed so you only need to query it once, does that make the implementation require a restart or a specific clearing of the cache when the computer system transitions between DST and non-DST? On my computer that function would return 0 or -60 depending on the DST-ness of the system but if it caches that value and uses the cache then the function risks returning the wrong value if it was cached before the transition and then called after the transition. I've seen this before on applications that run 24/7 and use the SECONDS() function due to the "caching" VFP does to facilitate SECONDS().


re: An Updated Web Connection Add-in for Visual Studio 2015

Sean Gowens
I installed VS 2015 several weeks ago and just got around to needing to use the 'show foxpro code' option. I couldn't figure out how to make it work, but as always I figured you were on top of things. Thanks so much.

re: yta Wait Message when submitting longer Requests


© Rick Strahl, West Wind Technologies, 2003 - 2018