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.
I often find it necessary to check that a string is valid by ensuring it exists in a list of strings. For instance, you might need to check that a
In general, disabling inheritance is a dubious idea. Yet under some circumstances it may be useful. To do this, declare the class in question (called A in our example) as
ew Orleans?A Microsoft spokesperson said today that the company would not hold its annual Professional Developers Conference (PDC) at its traditional time in the Fall this year. The company is
he ability to parse and transform XML documents is nothing new for Java developers. There are several packages available that come with the tools to do it. But these products
Sometimes you don’t want to enable the option of running more than one instance of an executable at a time. This can be achieved by using this fragment of code:
The algorithms in the standard C++ library are generic and, as such, can be inefficient (or unavailable) with certain containers.For example, the std::swap algorithm is generic but lists define an
C-style arrays can be passed as containers to STL algorithms. The pointers to array elements can be used as iterators.Example: #include #include int main(){ int array[] = { 1, 3,
If no other classes can derive from a class, then you know that all the pointers to that class point to objects of a uniform size. This can simplify memory
There is nothing intrinsically evil about ‘switch’ statements. However, they do sometimes result from improper Object Oriented design. There are twodesign principles to keep in mind.1. Open/Closed Principle: this states
The following code reads one string, and prints the length of that without using strlen(): #include #include int main(){ char s[20]; gets(s); printf(” %d “,printf(“%s”,s));/*return type of printf() is int.
// This example shows how we can use a non static// member variable or function in a static// member functionclass CClass{public: int m_Var;private: static CClass m_ptClasspublic: static void StaticMemberFonction();}CClass::CClass(){ ptClass
SQL Server stores datetime data in 8 bytes. The first four bytes represent the date and the second four represent the time. To axe off the time part of the
This method works for the MFC derived class and was tested on a Dialog-based class. Set Active Project Select Project –>Add to Project –>Components and Controls –> VC++ Components –>
When you write an IDL file and need to add specific C++ code in the header file created after MIDL compilation, you can use the the cpp_quote(” “) IDL construct.
There are two very annoying–yet completely avoidable–nesting errors that occur in C/C++ programming.1) This one typically happens toward the end of the day, thereby making the day longer: for (int
The System.Guid type exposes several shared and instance methods that can help you work with GUIDs, that is, those 128-bit numbers that serve to uniquely identify elements and that are
or many of you, this is crunch time. Whether you’re excited, mildly interested, or begrudgingly accepting, most Microsoft developers know that .NET is in their future. So, chances are, you’ve
To display the List Box of a Combobox automatically, without clicking it, you can use the SENDKEYS (“Key”,[Wait]) function. First, create a VB standard exe project. Then add a combo
aving a development environment provides excellent software change management because it ensures secure, isolated testing and production environments. However, for many IT shops, maintaining three environments is too much overhead.
ince the beginning of the year I’ve received multiple emails from DevX readers regarding a discussion titled “How can I retrieve set by set records from a table?” on the
s concern has grown over the security and efficiency of Web-based applications, validation of user input has increased its importance in turn. Relying on scripting for client-side validation is unmanageable,
You can set properties of the Pen object to create custom lines. For example, you can use the DashStyle enumerated property to draw dashed lines using a predefined pattern, and
VB.NET supports the creation of arrays on-the-fly, by using the New operator. For example, look at the following code, that uses GDI methods to display few connected lines ‘ Get
a gradient brush is a brush that contains all the color nuances that vary from a starting color to an ending color, like the typical background screen of many installation
GDI+ supports two different forms of a complex curve that can’t be represented as an arc of a circle or an ellipse: a cardinal spline and a B
GDI+ supports two different forms of a complex curve that can’t be represented as an arc of a circle or an ellipse: a cardinal spline and a B
ot so many years ago, when you went to buy a new car, among the many decisions you’d have to make about your “options” was whether or not you wanted
y last DHTML solution showed you how to create a tabbed user interface (UI). Unfortunately, the code to write the UI was specific for each document. It would be far











