September 28, 1999

Const & Efficiency

Question: Can you tell me which of these implementations is more efficient and why, assumming this function cannot be inlined and is called often? First option: int even( int &val){if (val%2==0)return val*2;else return val;} Second option: int even(const int &val){if (val%2==0)return val*2;else return val;} Answer: I see no reason why

Mathmatical Functions: Decimals

Question: How can I read only from one side of the decimal in VB6? I need to get .4286 from a value of 22.4286. I also need to know how to get the integer value of 108.75 to read 108 and not round up to 109. Please help, I am

Accessing A Password Protected
Database with Data Controls

Question: In a VB application, I have multiple forms with data controls on each form which connect to a password protected Access database. Every form pops up a message stating an invalid password. How do I connect to the database with the Data Controls specifying the password? Answer: I will

IIS – Manipulating the Metabase

Question: I have been trying to change settings for the IIS server in order that I can set the flag to allow an out-of-process Active X EXE Server to be used from within an ASP page. It seems that one can call an in-process DLL server without a problem, but

Templates

Question: I’m porting a UNIX app to NT; one of the class hierarchies includes something like this: template class base{ // stuff};template class derived : public base, public base{ // stuff}; When I compile it in MSVC6 I get the following error: c:projects est est.cpp(14) : error C2500: ‘derived’ :

JOptionPane

Question: When creating an input dialog box with JOptionPane.showInputDialog, isit possible to have a masking character, such as the * for password input? Answer: As implemented in the Sun JDK, JOptionPane.showInputDialog uses a JTextField to collect user input. Therefore, it is not possible to set a masking character. There is