The Latest

DevX - Software Development Resource

Record Retrieveal Using fscanf

Question: If three records have been written to a text file(each record having 3 int fields) and each integer field is seperated by a comma, how do you retrieve only

DevX - Software Development Resource

Returning a Pointer to a Member Function

Question: Let’s say I have a class foo, with a lot of functions that take no arguments and return SomeType: SomeType foo::bar()SomeType foo::quux()SomeType foo::quuux()SomeType foo::quuuux() Now I have a pointer

DevX - Software Development Resource

Get or Set the height of TreeView nodes

In plain VB there is no way to determine or change the height of node elements in a TreeView control. All you need to accomplish both tasks, however, is send

DevX - Software Development Resource

Traverse a Hashtable

Java hashtables are widely used to maintain a mapping relationship between objects. It is easy to store, and retrieve an object from a hashtable using an arbitrary key. Sometimes, it

DevX - Software Development Resource

Go Through Proxies With Java

Network administrators make use of proxy servers to enhance the security oftheir networks. A proxy server can be seen as a service that managesconnections between the internet and an internal

DevX - Software Development Resource

Dynamically Resize Your JLabels

There is a simple way to resize your javax.swing.JLabels to the text theydisplay.For an instance of javax.swing.JLabel called jLabel1, if there is not LayoutManager installed : jLabel1.setText (“A somewaht long

DevX - Software Development Resource

Uses of the ptrdiff_t Data Type

C and C++ define a special type for pointer arithmetic, namely ptrdiff_t, which is a typedef of a platform-specific signed integral type. You can use a variable of type ptrdiff_t

DevX - Software Development Resource

Initializing Array Class Members

You cannot initialize an array member in a member-initialization list of a class. For this reason, the following code will not compile: class A { private: char buff[100]; public: A::A()

DevX - Software Development Resource

Recompile Stored Procedures

Normally when a user calls a stored procedure, SQL Server does not create a new data access plan to retrieve the information from the database. The queries used by stored

DevX - Software Development Resource

Prefer Native Provider Over ODBC Providers

You can improve performance of your MDAC application by using native OLEDB providers instead of OLEDB provider for ODBC. MDAC 2.0 contains the native OLEDB providers for three SQL data

DevX - Software Development Resource

Understanding Memory Pages and Page Alignment

System memory is divided into units that are called “pages”. A page consists of 4,096 bytes (4K) on Intel architectures, and on Alpha systems it consists of 8,192 bytes (8K).

DevX - Software Development Resource

Choose the Right Value of User Connections Parameter

User Connections parameter is used to set the maximum number of simultaneous connections to SQL Server. However, the actual number of connections may be less, depending on database environment. The

DevX - Software Development Resource

TreeToys Class

VB2TheMax’s friend J.Swierz has sent us this great class module, that lets you add fancy and eye-catching tooltips to TreeView controls, that appear when you scroll the control with the

DevX - Software Development Resource

Determine if a Form is Open

Question: I have this real cool function to determine if a Form is Open which works fine in Access 97, but not in VB 6.0 because it does not support

DevX - Software Development Resource

Retrieving the Greatest Value from a Group

Question: I have a table like this one: Day_Period_Money (daydate date, period number, amount number); Here is an example of some data: daydate period amount01/01/99 1 1001/01/99 2 2001/01/99 3

DevX - Software Development Resource

Returning a Certain Number of Rows

Question: How do I get a query to return only a certain number of rows? For instance, a search criterion might return 100 rows, but I only want to see

DevX - Software Development Resource

NullPointerException

Question: Since there are no pointers in Java why is there aNullPointerException? Answer: It is a bit misleading to say that Java does not have pointers.Reference variables are very similar

DevX - Software Development Resource

Removing a Duplicated Item

Question: I have tried the following code: SELECT distinct title, id from table where …..order by title and it returns: A 001A 002B 003 The result I want is: A

DevX - Software Development Resource

Creating a Schedule Timetable

Question: I have a table with five columns. They are “No. of People,” “Tour1,” Tour2,” “Tour3,” and “Tour4.” I want to set up a query that shows me how many

DevX - Software Development Resource

Inactivity Timeout

Question: I’d like incorporate an inactivity timeout for an application.When there is no mouse or keyboard activity in the application fora certain period of time, I want to close all

DevX - Software Development Resource

Answering SQL Queries in Excel

Question: I’ve got an Excel workbook composed by a series of pages (worksheets). One of them is called ‘Wholesales’. I’ve tried to retrieve values even with basic syntax: select *