The Latest

DevX

StringFromBSTR – Convert a BSTR to a VB string

Private Declare Sub CopyMemory Lib “kernel32” Alias “RtlMoveMemory” (dest As _ Any, source As Any, ByVal bytes As Long)’ convert a BSTR into a VB StringFunction StringFromBSTR(ByVal pointer As Long)

DevX

StringFromAddr – Read a string at a given address

Private Declare Sub CopyMemory Lib “kernel32” Alias “RtlMoveMemory” (dest As _ Any, source As Any, ByVal bytes As Long)Private Declare Function lstrlenA Lib “kernel32” (ByVal lpString As Long) As _

DevX

The age of a person

You can quickly evaluate the age of a person using the following function: Function Age(BirthDate As Date, Optional CurrentDate As Variant) As Integer If IsMissing(CurrentDate) Then CurrentDate = Now Age

DevX

Calculating the Difference Between Two Times

When you need to compute the time that elapsed between two dates, use the standard function difftime(). This way, you avoid potential bugs such as leap years or Y2K issues.

DevX

Converting a Number to a String

The standard strstream family of classes enables you to convert numeric values into their string representation easily. You need to instantiate an strstream object, insert the numeric value to it

DevX

Linkage Specification

Linkage between C++ and non-C++ code fragments can be achieved using a linkage-specification. For example: extern “C” int func(int arg1); // func has C linkage The quoted string in the

DevX

Pass Template Parameters by Reference

In the following declaration of the template min, the template parameter T is passed by value: template bool equal(T first, T sec){// Related Posts Stuxnet Speculation Grows: Is Worm a

DevX

Formatting Tables in HTML Pages

The best way to tackle alignment/wrapping issues with invisible tables is tomake the tables visible. To do this, you should set the border property oftables that contain form fields or

DevX

Bool Values

Question: How do I make 1 bool take 1 bit instead of 1 byte? Answer: Instead of an array, you should use an STL container that is specifically designed to

DevX

Software to Convert Informix dat to dbf

Question: Is there any software that will convert database files from Informix to dbf files? Answer: I’m not aware of any. Sort of like rebuilding a Ferrari and putting in

DevX

Constraints on Social Security Number

Question: How do I put a named constraint on a social security number defined as number(9) so that no hyphens are allowed in? Answer: To prevent numbers with hyphens from

DevX

Large WML Files

Question: Can I arrange the WML information on my server in one huge file and still have it delivered to a WAP device? Answer: The largest “deck” you can have

DevX

WAP and Packet Formats

Question: Let’s say a WAP server has a WAP stack of the following layers: Connectionless WSP UDP IP Would you give me example packets that arrive at the server from

DevX

Exchange Server Slow Down

Question: Why does our Exchange server randomly slow way down once a day? Answer: There are a number of reasons why that could happen. I suspect you may find some

DevX

Compiler for BOOL in C++

Question: Can you please name a few compilers that implement bool? Answer: Almost every C++ compiler nowadays supports bool. You don’t have to define or #include anything; bool is a

DevX

Using #include

Question: I use from stl in a .h file: #include …….typedef vector IntVector; // error! But in the last line, the compiler returns the message: missing ‘;’ before ‘

DevX

Outlook Web Access and GAL

Question: Does OWA have access to the GAL to send messages to other users? Answer: Yes, Outlook Web Access (OWA) does have access to the Global Address List (GAL) from

DevX

Passing a CSV List Within an IN Statement

Question: I have a CSV list I am passing through as a parameter in a stored procedure. ——————————-Example of Region list:1,2,3,4,5,6,7,8,9,10CREATE PROCEDURE sp_getReport @Regionlist varchar(100) AS …….Select * from tblRegionwhere

DevX

Development Tools for WAP/ASP

Question: Which development tools currently are available for WML editing? Are any made specifically for ASP/WML? Answer: Personally I use Microsoft’s Visual InterDev for all my Web development, simply out

DevX

WTAI and WMLScript

Question: Can I use WTAI function calls to write and then read back numbers in the handset phonebook? Answer: The WMLScript to do this is: addPBEntry(number, name); This will add

DevX

JSP/WAP

Question: Does JSP support WAP? Answer: As long as you set your content type properly, any of the scripting languages can generate WML, which can be displayed on WAP-enabled devices.

DevX

WAP Configuration

Question: I have a Nokia WAP server 1.1 and toolkit 1.2. When I try to look into a WML page using Wapman, it gives a 406 error. What do I

DevX

Stopping Services for Backup

Question: As backup for a client, can I write a script in Exchange to shut down the service, copy all the data files to another drive, and then restart the

DevX

E-mail Forwarding With Exchange 5.5

Question: How does a person in my office forward certain e-mails from his account in the office to his external e-mail account? Answer: Sounds to me like Auto-Replies to the

DevX

Memory Layout of Objects

Question: If a program constructs an object (let’s say, foo) that has a number of large and involved methods 100 times, does it duplicate in memory all the code for

DevX

Asynchronous Calls and Callbacks

There are two ways to invoke a remote object through Remote Scripting: synchronously and asynchronously. The asynchronous approach is particularly useful because it doesn’t stop the user from working within