July 27, 1998

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, I certainly can’t think of any reason why you’d want to use C instead of C++. C++ is everything C

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 there. How can I correct this so that when I click the Close button the program completely closes down? Answer:

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 Basic 6.0 (scheduled for release on Sept. 2, 1998) includes the ability to “persist” a class, that is, to save

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 a specific signature. Interfaces can only be used to provide common method signatures.

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 a Java application you cannot make windowsappear on multiple screens without writingplatform-specific native code. From the commandline on a Unix

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 want a string representation of the IP address, use getHostAddress().

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 myself, and I’ve not had any problems until I started to use Microsoft’s Foundation Classes for Windows programming. I had

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: The answer to this question at first glance seems trivial, but is actually something that can stump someone who’s advanced

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 they might throw an exception? Answer: Although Java makes it easier to write robustprograms by providing compiler-enforced exception handling, Java

No more posts to show