This article may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist. To maintain the flow of the article, we've left these URLs in the text, but disabled the links.
|
|
GEEK We are using design-time control buttons in Visual InterDev 6.0. Can we use an <%if%> statement to test whether to use design-time controls?
GEEK Yes, you can exclude the code for a design-time control (DTC) button based on a logical test. You need to be careful how you do this, and make sure that you don't have any other client-side code on the page that assumes the button is actually there. This code should fail if it tries to manipulate a nonexistent element. |
<% if true then %>
Client-side code (HTML or script) that should exist
only if the test case is true.
<% end if %>
The truth test is happening on the server, and if it is true, then the code/text that is enclosed in the conditional block is sent over to the client. Now let's take the default code that Visual InterDev creates to be run at initialization of a design-time control button and modify it so that your button is hidden in such a scenario:
<SCRIPT LANGUAGE=JavaScript>
function _initButton1()
{
Button1.value = 'Button1';
Button1.setStyle(0);
<% if true then %>
Button1.hide();
<% end if %>
}
CreateButton('Button1', _initButton1, null);
</script>
GEEK I have just upgraded one of my Web servers from an old Intel box to a new Alpha box. I have noticed that the file fpcount.exe is running around 25 percent of my CPU time. I am running FX!32 on the Alpha, which was installed after all service packs and Option Pack 4.0 on Windows NT® 4.0 Server. From what I have learned from various Web sites, fpcount.exe is installed with FrontPage®, not the FrontPage extensions. This would make it an Intel rather than an Alpha executable. Is fpcount.exe running constantly as emulated?GEEK Fpcount.exe is part of the FrontPage Server extensions, and as such is included as a native Alpha executable. You can find usage and download information at http://www.microsoft.com/frontpage/wpp.
GEEK I've noticed that using the built-in controls in Visual InterDev 6.0 to develop a user interface quickly adds a considerable amount of script to an Active Server Page (ASP). I understand that extra code is required from the _ScriptLibrary to automate control functions, but even adding a data connection and only a few controls can require 500 lines in one ASP file! Wouldn't this put a strain on the Web server, especially if you had a thousand people visiting your site? Where do you draw the line between RAD Web development and efficient, hand-coded ASP scripts?
GEEK Development methods, processes, and tools always present their own tradeoffs and considerations. Using automatic code generation will almost always increase the deployment size of your application, but it will speed up your development cycle as well. So it is up to you to determine at what point these tradeoffs are worth it.
Often, RAD tools will make the difference in exposing some important functionality. Even increased deployment size is preferable to not having a solution at all. My own personal recommendation would be to develop solutions that fit your team's development abilities. If they can create better and more functional applications using RAD tools, then using them definitely puts you ahead of the game. If the impact on actual usage is negligible, then your solution is viable. If, however, you notice measurable performance issues that are unacceptable, then you need to go in and tune those specific areas with either hand-rolled code or a different approach. Many times, there are several different ways to approach a particular functional need in an application, and sometimes using the exact same toolsbut with a different methodwill result in a better-running solution.
Where and how you choose to make these tradeoffs is up to you. These decisions are based on the type of solution you are developing, the target audience, and the developers working on the solutionnot to mention the amount of money you are willing to spend. Obviously, clicking two buttons, entering a dataset name, and binding a recordset to a listbox takes a lot less time than hand-coding all of the necessary ASP that would provide a tuned version of this process.
GEEK What is the best way to display a last-modified time and date for an ASP? The standard method for HTML is the following:
The previous JScript® always displays the current time for ASP-created pages. This is due to the active nature of ASP, where the document is considered to change every time it is created.
<SCRIPT LANGUAGE="JavaScript">
<!-- START -->
var dateMod = ""
dateMod = document.lastModified
document.write("Last updated ")
document.write(dateMod)
document.write();
// -->
</SCRIPT>
GEEK The document object you are referencing in your code isn't referring to the file that the ASP is coming from, but rather the actual document being constructed through the processing of this file. You actually need to work with the file system to access the file currently being interpreted and display the appropriate information from it. The code in Figure 1 will display the name of the file being processed, its creation date, and its last modification date.
GEEK We have a Web-based app using Microsoft® Internet
Information Server (IIS) 4.0. The app is made up of ASP pages that instantiate Visual Basic 5.0-based objects without
Microsoft Transaction Server (MTS). We randomly get messages that say "Error ASP 0115: Trappable error." What does this mean?
GEEK This means you have run into an error while executing your object! Seriously, "Trappable error" is one of those catchall messages. One situation in which it comes up has to do with making database access calls via ADO to IBM DB2. There is a particular situation caused by the rapid loading/unloading of the DLLs necessary to perform this task that creates a chase condition, which brings up this error. If this is the problem, upgrading the IIS system to SNA Server 3.0 Service Pack 1 should eliminate the error messages. Work is being done on IIS 5.0 to provide far better error messages and debugging support for IIS components.
Since I'm not sure that this is the problem you are running into, you might want to try coming up with a test scenario that you can perform to produce this error semi-regularly. This will let you sneak up on the possible causes by backing off on most of the functionality within your object. Then slowly reintroduce the functionality until the problem reappears.
GEEK I have a couple of vertical-market software apps that are being rewritten for Windows®. I seem to need a Microsoft Help Compiler to compile RTF files into help files. Where do I get this magic device?
GEEK Almost all Windows-based development products (like Visual Basic®, Visual C++®, as well as development products from other companies) will include the Windows Help Compiler. It also comes as part of a subscription to MSDN, and members can download the most recent copy from the MSDN Web site at http://msdn.microsoft.com. You should first check with whatever development tool you are using to create your product. And, of course, you should have an active subscription to MSDN so you can look there as well.
The Windows Help format is similar to HTML and Web pages with some important differences. With Web client technologies improving so dramatically over the last couple of years, HTML and the Web page metaphor will soon be adopted as the standard for displaying application help in Windows-based applications. Moving forward, you may want to look at this as you design your Win32® help system. You can find more information about HTML Help at http://msdn.microsoft.com/workshop/author/htmlhelp. This site includes a full download of the tools necessary to develop your HTML Help title.
From the March 1999 issue of Microsoft Internet Developer.