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

Last 50 comments


re: Showing a Wait Message when submitting longer Requests



UAE dissertation Service
Exactly, this is what I was looking for my website.

re: Doing HTTP Headers right in Web Connection 5.0



Rick Strahl
Easy:

--CodeMarker--

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.Clear()
Response.Status = "404 File not found"
Response.Write("Page was not found")

TIA

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



faa
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



P.C.
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



liona1982
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



liona1982
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.

please wait...


<script>
alert("asjdasd as");
<script>

re: Clicks not working in Internet Explorer Automation from FoxPro



Sam
Hi
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: Syntax Errors in the FoxPro Editor caused by Extended Characters



Luca
Many thanks, Rick.
The experience is never enough!

re: Showing a Wait Message when submitting longer Requests


fsdgdfgdfgdfge dgdgf fdgfd
trdsgdfg dfgdf
gfdgfd fdgdfgdf gdfgdfdg gerggre

re: Calling JSON REST Services with FoxPro and wwJsonServiceClient



Jon
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.

re: Slow SET PROCEDURE TO and NEWOBJECT()


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.

http://mattslay.com/foxpro-newobject-fast-here-slow-there/

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 ?

TIA
Naeem

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?

--CodeMarker--

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?

Thanks

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



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

re: UTC Time in FoxPro



Jon
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.
Vince

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



BC
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.

_Screen.left=5
_Screen.top=5

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().

Paul

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


yijfbvdbbfdbdbvdfssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssb

re: UTC Time in FoxPro


Luis - not sure what you mean. All the code you need is here...

re: UTC Time in FoxPro



Luis Guerra
Hi Rick, interesting your article on UTC time. I've seen you're using functions from your tools, but, what about those people that do not use your tools but they want to begin using UTC time?

I'd would like you to point me in the right direction to begin using UTC time.

Best Regards,

Luis GUerra

re: A Preview of Features for Web Connection 6.0


Dear Rick,
please when you think to issue with version 6?
Many thanks

re: Visual FoxPro and Multi-Threading


Very nice and useful article Rick, thanks!

re: A Preview of Features for Web Connection 6.0



JimM
Thanks Rick... I'll be using wconnect for as long as it's out there.. Will also pay for New Versions... I've been using Meter.js lately.. it's pretty cool.. uses mongo as database.. however any developers new to Meteor dont like the fact that they have to use mongo "nosql" so SQL support is on the way... I thing someone is building a postgres driver.. would be cool to have a wconnect driver..

re: A Preview of Features for Web Connection 6.0


I can tell you right of that backwards compatibility - especially for client side features is not something that can be maintained. This update will bring some breaking changes especially for Web Control Framework as I am rebuilding the base CSS code.

This release is going to be about fixing and normalizing a bunch of things that were done in the past for reasons of backwards compatibility. This release is meant to put things into shape so the product can go on without being completely obsolete (even if FoxPro is going that way).

Also as I mentioned there will not be much change in the Web COntrol Framework. Focus will be on client side integration features (SPA applications, and updates for the Template/Scripting engines). WCF will get the CSS UI updates but not much beyond that.

re: A Preview of Features for Web Connection 6.0


Dear Rick,
I am enthusiast about a new version of Web Connection! I am very grateful to you because I can still work with Visual FoxPro just thanks to your fantastic framework.
My projects are updated to 5.62, I stopped to follow your upgrades when I ecountered compatibility problems, expecially with wwWebTabControl object. So about new features I would like to find in WC 6:
- compatibility with every 5.x layout feature
- ability to develop applications for mobile devices
- possibility to develop liquid layouts

Many thanks on advance :)

re: Transparent Bitmaps on Buttons and other Controls



Ernando Silva
Thanks for this helpful article Rick and Alberto.

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


@Steve - there's no command line option to unblock since this is a security feature that's meant to be done by the user explicitly off internet downloaded content.

There's additional info in the wwDotnetBridge FAQ:
http://www.west-wind.com/webconnection/docs/?page=_3rf12jtma.htm

If you don't have the 'unblock' option that just means the file is not blocked and so your issue is something else.

The other common things are:

* Network loaded assemblies (addressed in the link in the post and docs)
* Non-Full version of .NET (Client Profile is not enough)

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


Using Windows 7 Ultimate, I see no such security section and "Unblock" on the General tab of the Properties dialog.

Nonetheless seeing the wwDotnetBridge "Unable to load Clr Instance" error.

Any other ideas? Is there a command-line equivalent of this?

re: Using the VFP 9.0 Class Browser for PRG Files



Eddy Maue
&& Execute for add CB


Select 0
Use (_foxcode) Shared
* ****************************************** ET
Append Blank

replace abbrev with "CB"

replace expanded with ""

replace cmd with "{}"

replace tip with ReplaceCaractere([])


replace data with ReplaceCaractere([LPARAMETER oFoxCode]+Chr(13)+;
[]+Chr(13)+;
[LOCAL lcCmdLine, lcClassName, lcFunctionName, lcOutput]+Chr(13)+;
[]+Chr(13)+;
[ ]+Chr(13)+;
[]+Chr(13)+;
[lcClassName = INPUTBOX(õClass Fileõ,õOpen Class Browser õ)]+Chr(13)+;
[]+Chr(13)+;
[ ]+Chr(13)+;
[]+Chr(13)+;
[oFoxcode.valuetype = õVõ]+Chr(13)+;
[]+Chr(13)+;
[ ]+Chr(13)+;
[]+Chr(13)+;
[IF EMPTY(lcClassName)]+Chr(13)+;
[]+Chr(13)+;
[ RETURN lcCmdLine]+Chr(13)+;
[]+Chr(13)+;
[ENDIF]+Chr(13)+;
[]+Chr(13)+;
[ ]+Chr(13)+;
[]+Chr(13)+;
[lcFile = lcClassName]+Chr(13)+;
[]+Chr(13)+;
[IF !FILE(lcFile)]+Chr(13)+;
[]+Chr(13)+;
[ lcFile = lcFile + õ.prgõ]+Chr(13)+;
[]+Chr(13)+;
[ IF !FILE(lcFile)]+Chr(13)+;
[]+Chr(13)+;
[ lcFile = lcClassName + õ.vcxõ]+Chr(13)+;
[]+Chr(13)+;
[ ENDIF]+Chr(13)+;
[]+Chr(13)+;
[ IF !FILE(lcFile )]+Chr(13)+;
[]+Chr(13)+;
[ return lcCmdLine]+Chr(13)+;
[]+Chr(13)+;
[ ENDIF]+Chr(13)+;
[]+Chr(13)+;
[ENDIF]+Chr(13)+;
[]+Chr(13)+;
[ ]+Chr(13)+;
[]+Chr(13)+;
[return ñDO (_BROWSER) with õò + lcFile + ñõò])

replace case with "M"

replace save with .T.

replace timestamp with Datetime()

replace source with ReplaceCaractere([RESERVED])

replace uniqueid with Sys(2015)

replace user with ReplaceCaractere([])

replace type with "U"
Use in FOXCODE

Procedure ReplaceCaractere(lcTxt)
Return Chrtran(lcTxt,Chr(241)+Chr(242)+Chr(243)+chr(244)+Chr(245),"[]'&"+Chr(34))

re: wwDotnetBridge for FoxPro .NET Interop is now Free and Open Source



venu
Hi,

I have one doubt calling CreateClrInstanceFrom function. I have .net dll written in C#.net. I am able create object in vfp, but couldnt run a static function written in C#, throwing unknown name error.

If you have solution please let me know, It helps me a lot. thanks in advance.

Venu.



© Rick Strahl, West Wind Technologies, 2003 - 2017