The Latest

DevX

Learn Control Array Bounds

You can use a control array’s UBound and LBound properties to determine how many controls are loaded. This code fills a string with the captions in the Label1 control array:

DevX

Right-Justify or Left-Justify Text

Use the Format$ function to produce right- or left-justified text: Format$(123, “@@@@@@”) gives ” 123″Format$(123, “!@@@@@@”) gives “123 ” Related Posts Adding Longs Without OverflowingAdjusting Views to Reduce Visibility of

DevX

Close Forms Uniformly

To close forms uniformly, treat the system menu’s Close command and your File menu’s Exit command in the same manner. In your Exit command, simply unload the form. Let the

DevX

Create a new Project Template

Upon initialization, the VB5 IDE presents you with a list of project types, such as Standard EXE or ActiveX EXE. You can also create new project types yourself by creating

DevX

Multiple Actions on One Event

To put two actions for one onmouseover=” ” event, just separate the two actions with a semicolon just like you would any two JavaScript statements. For example: OnChange=”alert(‘First Action’);alert(‘Second Action’)”

DevX

String Objects and C-strings: Caveats

The standard string class has a dual interface: it supports both C-style strings as well as string objects in various operations: const char text[] = “hello world”;string s = text;

DevX

Function Overloading

In order to overload a function, a different signature should be used for each overloaded version. A function signature consists of the list of types of its arguments as well

DevX

Pre-Defined Macros

All C/C++ compilers define the following macros: __DATE__ //a literal containing the compilation date in the form “Apr 13 1998″__TIME__ //a literal containing the compilation time in the form “10:01:07″__FILE__

DevX

Prefer dynamic_cast<> to typeid()

A robust, long lasting OO design relies on the premise that an existing class can be re-used in the future by means of derivation. Therefore, examining the actual type of

DevX

Simulating Inheritance of Assignment Operator

As opposed to base class’ constructor and destructor, which are automatically invoked from the derived class’ constructor and destructor respectively, a user-defined assignment operator defined in a base class is

DevX

<SPAN> Attribute in IE

Question: I’ve been working on completely redoing my company’s Web site for over a month and a half now. To help me out, I bought a book on HTML 4.0

DevX

C vs C++

Question: What is the main difference between Visual C and Visual C++ in Windows environments? Why would I want to use C++ instead? Is there any functional difference? Answer: Well,

DevX

Closing an application

Question: When I press the Close button on my app’s main form, the program appears to end. When I look at the Windows task list, however, my app is still

DevX

Saving Object to File

Question: Is it possible to save an object (in my case a collection) directly to a file, or must one extract the object’s properties and save each individually? Answer: Visual

DevX

Java interfaces and constructors

Question: Is there a way to force a specific constructor with an interface? Answer: No, there is no way to force implementors of a given interface to use constructors with

DevX

Java and Dual Monitor Unix Workstations

Question: I have a question regarding use of dual monitorUnix workstations to display Java screens.Specifically, can I display the mainscreen on onemonitor and the popup on another monitor? Answer: Within

DevX

InetAddress to String

Question: Is it possible to convert from java.net.InetAddress to string? Answer: Yes. Just call the InetAddress toString() method. Also, if you specifically want the host name, use getHostName. If you

DevX

Approach to studying C++

Question: My development background primarily involves COBOL and BASIC on UNIX platforms. I decided to further my language knowledge and branched out into C & C++. I’ve largely been teaching

DevX

Exception to String

Question: Given an exception, how do I convert the stack trace into a string? I want to capture the entire contents, the message and the trace, to a string. Answer:

DevX

Mandatory exception handling

Question: Why should some of the statements that might throw an exception be in try/catch block (otherwise the compiler reports a syntax error), and some need not be, even though

DevX

Dynamic memory allocation

Question: How do you dynamically allocate memory for a two-dimensional array? This is what I had, and my g++ compiler didn’t like it: int **m;m= new int [100][100]; Answer: Yep.

DevX

Closing an application from another app

Question: How do I use one application to close another application in Windows 95? I need to overwrite a loaded DLL, so I have to close the application that loads

DevX

Recursion

Question: Is it possible to make recursive subroutine calls in Java? Answer: Yes, you can make recursive method calls in Java.Just make sure you have a termination condition to avoid

DevX

C/C++ system() equivalent

Question: Does Java have a command that does what thesystem() function does in C, or a way to emulatethis action? For example, in C, system(“ls”); would call “ls” from the

DevX

Converting text to a binary code

Question: I’m using Borland C++ to perform some data conversion, and I have had some difficulties. Is it possible to convert all the text (including nonreadable text) within a text

DevX

Applets, URLs, and frames

Question: I want my Web page to have three frames: one for my applet and the other two for information. How can I make it so my applet updates both

DevX

Windows Programming (custom windows)

Question: I am trying to program my own custom controls in C++ in the old, traditional style (using WNDPROCS, etc.), and I don’t want to use ActiveX. I’d like to