October 25, 2006

Avoid DLL Hell with Registration-free COM

eusable, dynamically linked components are generally a good idea, because they allow you to leverage code and save memory rather than reinvent the wheel. But with thousands of developers leveraging thousands of native DLLs?and no OS-enforced systematic control of versioning or installation, developers often overwrite their own and others’ DLLs

Using auto_ptr

Suppose that a function normally allocates memory for an object, uses it, and then deallocates the memory. But if the function exits before reaching the end, either because of a return statement or an exception, it must still not exit without deallocating the memory: void foo(int n){ my_class* ptr =

Placing Multiple Headers in a DataTable

A DataTable can only handle one header for each column. The workaround for this is to use two tables. Generate the first table at the same time as the DataTable and the other one using HTML. The HTML table will contain the headers, however many you desire. Next, align the

Book Excerpt: The Java Tutorial, Fourth Edition

he Java Tutorial is hands-on Java programming language guide that is perfect for any developer looking for a proven path to proficiency with Java SE. This popular tutorial “from the Source” has been completely revised and updated to cover Version 6 of the Java Platform, Standard Edition. Written by members

Use XSL-FO to Obtain a Page Number

This tip shows you how to use the fo:page-number and fo:page-number-citation elements to insert page numbers. To insert page numbers in your page’s footer, use fo:static-content: Page [] of [] To find out how many pages are in the document, simply insert a blank fo:block in the last fo:page-sequence, like