Flicker-Free Web Pages (no javascript required)

I’ve spent the last few weeks playing with ASP.NET 2.0, and I’ve enjoyed using the AutoPostBack feature of the various server controls.

But one thing that drives me nuts is flickering web pages from the aforementioned AutoPostBack-enabled server controls, especially in the “Web 2.0 – Everything Is AJAX And If It’s Not It’s Just Crap” times we live in.

So, I started thinking more and more about AJAX, specifically the ASP.NET AJAX extensions. I started reading articles, help files, and book chapters but, doggone it, I just didn’t get the concept.

Then I watched a video on the ASP.NET web site that gave me the “a-ha!” moment I needed.

Basically, you just do the following:

  • Add a ScriptManager control to the page
  • Add an UpdatePanel control (for the piece of the page you want to update
  • Set the <ContentTemplate> tag of the UpdatePanel (this is the HTML you want displayed in the UpdatePanel part of the page)
  • Set the <Trigger> tag of the UpdatePanel, telling it which control and event on the page that should “fire” the update

I put together a small web site to demonstrate the results of the “a-ha!” moment, and also put together a screencast to show anyone that hasn’t yet had the “a-ha!” moment how easy it is to add partial page update functionality to an existing web page.  Be sure to click the “full-screen” button for best results.

Please, before I start getting comments about how elementary my code and examples are, let me say this: “I am a Visual FoxPro developer, not a .NET developer, and I’m learning this stuff day-by-day.”

And here’s a link for the code.

Side note: the downloads are hosted in a public folder I set up on Skydrive. No bandwidth charges, and no hosting charges! Just a thought for folks who might have something cool to share but do not want to pay out the wazoo if it becomes popular.

Enjoy!


This post originally appeared on Blogger.

DLL Hell Rears Its Ugly Head

If there’s a moral to this story, it’s this: Watch Your Runtimes.

Oh, yeah, and this: Trust No One.

A little background:

Last year, I had an opportunity to develop a shrink-wrap application using Visual FoxPro 9.

The product was originally released in March of 2007, built with Visual FoxPro 9 Service Pack 1.

A couple of months ago, we released a major version update.

The new version was built with Service Pack 2.

Now, before the “I-Won’t-Install-Service Pack 2-Because-I-Heard-It-Has-Some-Bugs-And-Besides-I’m-Mad-At-Microsoft-For-Killing-FoxPro” crowd starts drooling at the prospect of this being a ‘Service Pack 2 Killed My App’ post, let me say this:

“Install VFP 9 Service Pack 2. Today. Stop reading this, and go try it out. Try it on a test machine. Try it on Virtual PC. Just try it! Quit whining about what it might do to your apps, and go see for yourself. You’ll never know until you try.”

Whew! That felt good to get that off my chest. Now, back to the story:

Everything was going great, until I received the following support email:

I’m getting a Visual Fox Pro error in shared file.
The error log is not telling me anything else.
Microsoft Visual FoxPro
Fatal error: Exception code=C0000005 @ 03/27/08 05:16:37 PM.
Error log file: C:Program FilesCommon FilesMicrosoft SharedVFPvfp9rerr.log
Does this mean anything to you?

A C0000005 error? Rut-roh…

I exchanged several emails with the user, trying to determine when, where, why, and how this was happening.

During the course of the email exchanges, the user sent me some screenshots.

She stated that the “first” error occurs immediately after clicking the application icon on the Windows desktop:

UhOh

If she clicked the “What data does this error report contain?” link, she got the following:

ErrorRpt

Well, that tells me alot. 😉

She clicked close on the window above, then clicked Don’t Send on the previous window, then boom:

C00005

While researching the issue, another user sent me almost the exact same email. He was very upset about the error, because it seemed to him that this thing called Microsoft Visual FoxPro was obviously some kind of spyware/malware/virus or something. After all, why else would the error report contain all these weird-looking code-thingies like ModName, ModVer, ModStamp, fDebug and Offset? After Googling “Visual FoxPro”, he went onto an MSDN Forum to ask why this was happening.

In-house, we tried and tried and tried to recreate the issue. No go. We couldn’t recreate the error no matter how hard we tried.

The next day, the first user sent me another email:

I’ve figured it out!!!!

Your updated program is fighting with another Visual Fox Pro program on my machine:

I discovered this when I opened the program and received the same error.

Both programs are very important to me and I’ve also been in touch with them, too. I’m hoping we can get all the programmers heads together to figure out how to resolve the problem.

Can you tell me which VFP version you are using for your program so I can report back?

I asked her for the name of the “other” program, and I went to their website and downloaded a 30-day trial version of their software. I fired up Virtual PC and installed the program. Imagine my surprise when I saw the Wise Installer putting VFP9R.DLL in the C:WINDOWSSYSTEM32 folder.

While you’re at it, also imagine my expletive-filled shouts while watching the install.

RunTime

These runtime files, from that “other” program, were Visual FoxPro 9 Service Pack 1 runtimes.

I then installed my app, which put the runtimes in the following folder:

VFP9SP2

Started up my app, and BOOM!!! The issue has now been “officially” recreated.

I contacted the makers of the other software, and pointed them to the FoxWiki pages about VFP Runtimes.

But, not wanting my app to be at the mercy of another development shop, I changed my installer to just dump the VFP 9 SP2 runtimes into the folder where the app is installed.

Fixed

No registration, no nothing. Just a file copy.

I restarted my app, and it worked! Woo Hoo!!!

I sent the new installer out to the affected users, and they reported back that the “new version” worked. I loved the “new version” part, because the only thing that changed was the install itself.

Of course, the “other” app was still broken, because when my app was originally installed the new VFP runtimes were registered on the system.

A quick reinstall of the “other” app caused the VFP 9 SP1 runtimes to be re-registered in C:WINDOWSSYSTEM32, and now both programs “work” and my users are happy once again.

From now on, all of my apps will have the VFP Runtimes placed in the same folder as the app itself.

Watch Your Runtimes.

Trust No One.

This post originally appeared on Blogger.

John Koziol: Welcome to Jiffy Tech

Great post by John, with a dead-on analogy. Here’s a snippet:

“I remember having a conversation with a friend of mine over beers back in the mid-80’s. He was trying to understand exactly what it was I did and why it paid so well. I thought for a moment and replied that we were the “priests in the temples in the Dark Ages”. We were elite because we knew how to read in an illiterate world. But one day, as technology spread, we’d be the new auto mechanics.”

This one is a must read.

gonzomaximus: Welcome to Jiffy Tech

Easy Transparent Forms with Visual FoxPro

Want an easy way to make your forms transparent in Visual FoxPro? How about a little class to drop on your form.

The TransparentForm class will automagically make your TOP-LEVEL form (ShowWindow = 2) appear semi-transparent.

Note: This works on Top-Level forms running on Windows 2000 or higher only. You won’t see any effect on Windows 98 or on any form that does not have ShowWindow = 2.

Also, this was created with Visual FoxPro 9.0 (it works unchanged in VFP 7 and 8). If you want to run it in VFP 6, you will need to change the references to ThisForm.hWnd.

How do you use it? Drop it on a form, and set the nOpaquePct property to the percentage of opaqueness that you want the form to have (the default is 90).

Here’s a few pictures of the sample form in action:

With 90% ‘Opaqueness’:

 

75% Opaqueness:

 

50% Opaqueness:

 

You can download the class and sample form here (4 kb).

This post originally appeared on the Foxite Weblogs site.