devxlogo

We are an award-winning tech entrepreneurship website where trusted experts can provide value globally.

Since 1998, DevX has helped people start businesses, build websites, and provide enterprise technology to people globally. Interviewing the likes of Microsoft’s co-founder, Steve Ballmer, the publication brings comprehensive, reliable, and accessible insights to the Internet.

devxlogo

Trusted for 26 years

Over 30K Articles

1M+ Readers

Expert-reviewed

10K+ Tech Terms

As seen in:

microsoft logo
business_insider_logo
wired_logo
berkley
arstechnica_logo
hackernoon

The Latest

How to Access the Topmost Element of a Stack

You can access the topmost element (the one pushed the latest) of a stack container by using the member function top(): #include #include #include using namespace std;void main() { stack

Type-o-matic Text Box

This code creates a smart input box. Every time you type something into this text box, the first letters of your string are compared against the members of a hidden

Viewing bool Variables as Literals

By default, iostream objects display bool variables as 0 and 1. You can override the default setting by inserting the formatting flag boolalpha to the object stream. Consequently, the symbolic

Two Flavors of dynamic_cast<>

The operator dynamic_cast comes in two flavors: one uses pointers and the other uses references. Accordingly, dynamic_cast returns a pointer or a reference of the desired type when it succeeds.

MessageBox Advantage

You’ve probably noticed that the display time stops when an application pops up VB’s built-in MsgBox. Although the system timer continues to tick, the timer control isn’t updated every second,

Enum API Constants Save Time Coding

You can simplify Win32 APIs by using enumerated types instead of constants. When you use enumerated types, VB provides you with a list of values when you define the API

Risks of Using Reflection

Reflection plays an essential role in adding dynamism to Java. Using reflection, an application can dynamically (i.e., at run time) determine the state and behavior of any class. Reflection allows

Capturing a type_info Object

The operator typeid returns a const type_info object associated with its argument. However, the returned object is a temporary one, so if you have to call several member functions from

Applying too Much Style can Hurt Readability

Cascading Style Sheets (CSS) provide a good way to apply a style sheet to a section of text. With CSS, you can redefine how HTML tags work, for example making

How to Generate a Sequence of Random Numbers

Standard C provides two functions for the purpose of random number generation–rand and srand. The function rand generates a sequence of pseudo-random numbers. The term pseudo-random implies that the generated

Adjust Combo Box Drop-down Width

Due to limited space on a form, you sometimes must keep the width of combo boxes small. Because a combo box lacks a horizontal scrollbar, some text might remain hidden.

Ragged Arrays

Who said arrays in VB can’t change all dimensions while preserving data? I call this the “variable dimensions array,” and I use it when applications need data arrays with more

Third-Party Spell Checker

Question: I’m looking for a third-party library that does spell check and has some grammar rules. Answer: You have two solutions to this problem. One: you can purchase a third-party

Import Objects in Power Builder 5.0

Question: How can I import objects in code? I need to import to a library objects such as userobject and window, and not only datawindow. I use the function libraryexport

PBD to PBL Conversion

Question: Are there any tools that can generate back from PBD to PBL? Answer: There are no tools that I know of to reverse-engineer a PBD to a PBL. In

Response window looses focus in DW

Question: I have a datawindow with a couple of fields where users can double-click to see a code table. The code table window is a response window. The problem is

Primary Key Identity

Question: I have installed Service Pack 4 for SQL Server and Service Pack 4 for NT. I still receive this same error. Your Q&A suggests that this problem was fixed

NT Date Format

Question: I am trying to develop a VB program to interface with a database from a third-party imaging product. The database is SQL Server and the product stores dates as

Key combinations

Question: I’m developing an application for NT 4.0, and I don’t want that a fell key combinations works. So the question is, where can I disable functions such as Alt+Tab

DLLs on NT

Question: I’ve written an application that uses external DLLs. It works fine on Win95. When I try to load it on NT, it says it can’t find any of the

Returning strings from functions

Question: I would like to write a function that receivesan integer and converts this into a string representing the integers value in binary. At the moment I am struggling to

Array of pointers.

Question: I need to pass an array of pointers to a class to a function. The function is: void myFunc(myClass *example[]); The problem is that I need to define the

Creating a Guaranteed Unique Filename

Question: How can a unique filename be constructed that guarantees that it will be unique across processes? Answer: There is unfortunately no Java 1.1 analog to the POSIX tmpnam() C

Size of C++ executable

Question: Does one need a runtime DLL for an .exe file written with MFC in Visual C++? Can one make a standalone .exe program with C++ that is small and

Programming Languages

Question: My company, a strictly a VC++ development group, is considering developing a large real-time database/imaging application in both VB and VC++. What are the pros/cons of doing this, and

A pause function

Question: I cannot figure out a pause function for C++. Our books are very generic…can you please help? Answer: To pause for a given amount of time, you will need

fflush()

Question: I am having difficulty finding information and examples on how to use the flush function. Answer: If you are not sure how to use this function, then you probably

Extracting bits.

Question: How do I extract the value from a certain number of bits of an unsigned type? ex: date is stored as unsigned date = 0x26cf; bits meaning 0-4 Day