The Latest

DevX - Software Development Resource

Nonblocking I/O

Question: Say I have 10 sockets and I want to have a thread which checks for a message from the sockets using their InputStreams. The thread will wait in the

DevX - Software Development Resource

Capturing KeyEvents

Question: How can I capture KeyEvents in a Frame that doesn’thave any TextFields or TextAreas? Answer: To enable a particular AWTEvent in a Component it suffices to add alistener for

DevX - Software Development Resource

A Simple Sort Not Working

Question: I have the following: sql=”select * from products” How do I sort or order by two columns retrieved in the “*”? Answer: You need to specify them directly in

DevX - Software Development Resource

Detect if the Submit Button Was Pressed

Question: How do I tell if the ‘submit’ button on a form has been clicked when I call the ASP page back to process the input? Answer: If you set

DevX - Software Development Resource

ASP String Functions

Question: I have a string that changes in length and has information separated by commas. For instance, it might contain something like: agfd, addc, aprev, ads, adft I need a

DevX - Software Development Resource

Get Milliseconds From Time in ASP?

Question: Can I get milliseconds from time in ASP? For example, 12:30:00.234 HH:MM:SS.fff. Answer: No, not without using a custom COM component that will return the milliseconds. But then, by

DevX - Software Development Resource

Cannot Use Server.CreateObject on Client

Question: I created an ActiveX DLL that contains a class used to hold application settings. I registered the DLL (and a subsidiary DLL) on the Web server, but when I

DevX - Software Development Resource

MySQL to MS SQL Syntax

Question: I have the following dump for MySQL and am having a problem getting it corrected for MS SQL. Can you help? Here is the dump file: # MySQL dump

DevX - Software Development Resource

Catching Exceptions

Question: Do you have to individually catch each exception that a method maythrow? Or can you just have one generalized catch?For example, can I do this?: try{ method1 //which throws

DevX - Software Development Resource

Encryption Classes

Question: Are there any standard classes for performing one-way encryption ofstrings (e.g., passwords) in Java, similar to crypt() on Unix systems? Answer: The Java core APIs do not include an

DevX - Software Development Resource

Global Variables

Question: One of the things left out of Java that we had in C++ wasglobal variables. Is there a way to use global variables in Java? Answer: Even though Java

DevX - Software Development Resource

Editing Report Details in Print Preview

Question: Is it possible to edit report details in a print preview window? For example, if the report previewed has a line in it that I wish to remove, can

DevX - Software Development Resource

List Selection Actions

Question: When someone selects one item on my list, I want an inputfield to appear next to it. How do I do this? Answer: Rather than provide you with the

DevX - Software Development Resource

Generating KeyEvents

Question: How can I generate a Key Event from Java?I need to generate a KEY_TYPED Event, so the focused Component accepts it like normal key action. Answer: All you have

DevX - Software Development Resource

Submitting a Form Without a Submit Button

Question: How can I submit a form in ASP without a user clicking on a button? I tried: nameofform.submit() but I get the error: Microsoft VBScript runtime error ‘800a01a8’ Object

DevX - Software Development Resource

Passing Dates to Databases from ASP

Question: How can I pass a date to a database using ASP? Answer: The answer depends on what database you are using. Say you are using a variable called ‘strDate’

DevX - Software Development Resource

Window Maximization

Question: How do you set the maximized state of a window within code? Answer: The Java AWT does not provide an interface for maximizing a window.The Swing JInternalFrame supports a

DevX - Software Development Resource

Killing a Form

Question: Is there a way for me to kill, destroy, release, or otherwise cancel a form that has hung, without quitting the current instance of Visual FoxPro? I’ve tried practically

DevX - Software Development Resource

Foreign Keys

Question: How do I temporarily disable foreign keys in a table, insert more rows, and then enable them again? In particular, I need to know about syntax and what the

DevX - Software Development Resource

Use Strict Type Variables

If you want to improve performance of your application then you should always try to use strict type variables. You can use strict type (or strongly typed) variables by referencing

DevX - Software Development Resource

Control Transaction Rollback

If a run-time statement error (such as a constraint violation) occurs in a batch, the default behavior in SQL Server is to roll back only the statement that generated the

DevX - Software Development Resource

Determine whether a folder is shared

The Windows shell provides a simple way to detect whether a given folder is shared or not. You must call the SHGetFileInfo() API function and analyze the way it fills

DevX - Software Development Resource

Display the Find system dialog

If you ever needed to programmatically enable your users to search for files, you certainly found useful the possibility of reusing the system Find dialog integrated in the Start menu

DevX - Software Development Resource

Determine whether a program is 16- or 32-bit

Even if we’re living in a 32-bit world, and closer and closer to the 64-bit day, 16-bit programs are still running out there. Knowing whether a given EXE is 32-bit

DevX - Software Development Resource

Provide a free preview of Office Documents

NOTE that this tip requires Windows 98, Windows 2000, Windows 95/NT 4.0 + Active Desktop.If your application must do a lot of work with Office documents, then chances are that