Placement-New Requires Heap-Allocated Buffers
The placement-new operator constructs an object on a pre-allocated buffer. The pre-allocated buffer has to be allocated on the heap. char *pbuff = new char[1024]; // heap allocation using plain
The placement-new operator constructs an object on a pre-allocated buffer. The pre-allocated buffer has to be allocated on the heap. char *pbuff = new char[1024]; // heap allocation using plain
The Standard Template Library (STL) is a collection of generic algorithms and containers. It provides a new approach in software development, namely, generic programming. How does generic programming differ from
A unique name of an identifier consists of its namespaces(s), each followed by scope resolution operator, then its class name, and finally the variable itself. Since both namespaces and classes
In order to block creation of class instances, you can declare its constructor as protected. class CommonRoot { protected: CommonRoot(){}//no objects of this class can be instantiated};class Derived: public CommonRoot
The WhatsThisButton property returns or sets a value that determines whether the WhatsThisButton appears in the title bar of a Form object during run time. For the WhatsThisButton to appear
If you want to print text on an object with 3-D effects, use this subroutine to convert fonts into 3-D fonts with borders. In this routine, the user can define
Use the built-in AppActivate command to switch to another application easily if you know its title. You can even close the application programmatically: ‘This will close appPrivate Sub CloseApp (AppTitle
By default, the right-click functionality needed for What’s This? Help is not available in VB. Selecting a menu command from a context menu created for the button lets you display
Question: Hi, we have a secure server that has anonymous Web Access removed from the relevant directories. This works fine with Internet Explorer, but with Netscape it fails completely. Whatever
Question: We have an ASP application that queries a database and returns the data to formatted pages. The user would also like the data returned in a .CSV format for
Question: I have a Web site that forces a login with NT security. (Thus the person has to have an NT account to login.) I want to include a logoff
Question: What are the big differences between the March pre-release beta and the final release of Visual Interdev? Regards,Brooks Martin Answer: I suppose the biggest difference is that the March
Sometimes it is useful to keep track of users’ file download activity on your site. When a user clicks on a hyperlink to download a file, you can run an
In some frameworks (MFC, for instance), it’s customary to add the scope resolution operator :: before a global function’s name to mark it explicitly as a function that is not
The Graphics.create() method is a convenient way of creating a copy of a Graphics context. For example, you can use the Graphics.create() method if you want to make a copy
Assume you want a text control with a vertical scrollbar, but you don’t want users to be able to modify it and you don’t want users to see any caret
Question: I need to write a query that selects the maximus sum for a group from a list like the one below. Type ValueA 100B 200C 300A 300B 100C 342
Question: I have a table, called bugs. I have an insert trigger on the bugs table that generates a unique id, called bug_id. When I perform an insert into bugs,
Question: I’m trying to work on the basics of event handling. I found it easy to set one label and have the scrollbar change the value of the label. I
Question: How do I add a JButton to the cells of a JTable? Answer: Using the Swing JTable class can become a sticky business when you want to customize it
Question: For what uses can the Graphics.create() method be used? Answer: There will be cases where you want to make a copy of a Graphics context and make some alterations
Question: How can you make a canvas nonresizable? The canvas automatically resizes when the frame is resized. Answer: The default layout manager for java.awt.Frame is BorderLayout. BorderLayout will expand the
Question: I am a beginner in SQL and can’t figure out how to do this: I have two tables with three fields in the row of table1 referencing a master
Question: On a Windows NT box with multiple processors, will a multithreaded Java application get split between the processors automatically? Answer: This depends on the version and vendor of theJVM
Question: I have a frame with a few textfields on it. How can I set the focus to the first textfield? Is there something like setFocus? Answer: A component can
Question: How do I program the right mouse button to bring up a window or dialog box when I right-click on a particular button? Answer: All Java AWT components exhibit
Question: What is the correct way to backup a SQL Server database? I’m new to SQL Server and don’t know where to start. Answer: The best place to start would
Question: Is there a way to get memory allocated that is global to the current process? Thread local storage won’t do the trick because you need a global handle to
Question: Can you do operator overloading in Java? If so, how? Answer: Java does not as of yet support operator overloading, and there are no signs that it will ever
Question: In PL/SQL, the following syntax is allowed: SELECT * FROM table WHERE ROWNUM < 25 This would return the first 24 rows of a table. Is there anything equivalent