June 2, 1999

Accessing a C++ Object in C Code

C code, which of course is unaware of object semantics, can access the data members of a C++ object directly, but certain requirements must be met. There are some guarantees about the underlying memory layout of an object. C code can take advantage of these guarantees and treat a C++

Avoid ODBC Truncation Warnings From MS SQL Server

You can use ODBC settings to avoid truncation warnings from MS SQL Server. These warnings occur when the application tries to insert or update data that is larger than its length in the database. The default behavior of the ODBC driver is to return these warnings to the application.You can

Threading Piped Streams

Piped streams are typically used in separate threads. One thread writes output to a PipedOutputStream. The other thread reads the same data from a PipedInputStream. The two streams are connected either through their constructors or through an explicit connect() method. To find out how to instantiate piped streams, see the

Running Piped Threads

In a typical application using piped streams, an object of type PipedInputStream and an object of type PipedOutputStream are started as separate threads. One thread uses a PipedOutputStream to output data. The other thread uses a PipedInputStream to read in data. The two streams are connected through a connect() call

Set Objects to Nothing

If you set objects to Nothing, then test their nothingness, this suggestion might help you. If you declare an object as New and later set it to Nothing, VB won’t set the object to Nothing. For example, if you declare an object using this code: Dim oSomeObject As New SomeClass

Hashed Associative Containers

The Standard Template Library (STL) provides only one type of associative container–the sorted associative container. The STL sorted associative containers are map, multimap, set, and multiset. However, there is another type of associative container: the hashed associative container. This container should really be in the Standard Template Library but isn’t

Pretty Print Your HTML and ASP Code for Visitors

If you are preparing Active Server Pages code for printing or for code review it helps to make the script as tidy as possible. A free utility called HTML Tidy from http://www.w3.org/People/Raggett/tidy/ does an excellent job of putting HTML in order. Unfortunately, Tidy doesn’t preserve ASP code. For example, it

Track MousePointer Changes

If you develop large apps, this routine can help you keep a count of calls to change the mousepointer. The routine, called MouseStack, keeps a stack of those calls and resets the pointer to the default when the stacks are equal or when a reset is forced. Often, one routine

Use Native Trackselect in TreeView and ListView

You can make your TreeView or ListView control behave like a menu so that as you move the mouse cursor over the items, the highlighted item moves with the cursor. Use this code in the TreeView or ListView’s MouseMove event: Private Sub TreeView1_MouseMove(Button _ As Integer, Shift As Integer, x

No more posts to show