October 29, 1998

Cancel a Pending Print Job

In the tip, “Please Stop Printing!” [“101 Tech Tips for VB Developers,” Supplement to the August 1997 issue of VBPJ, page 13], the code works fine with one exception. If you use PrintManager, anything printed before you press the Abort button is sent to the printer. This code uses the

Clean Dried Marks on Your White Board

If old words or marks have dried on a white board and you can’t wipe them off, write on top of them with a fresh pen and then rub them off. This also works if someone has used a permanent pen.

Export SQL Data to a Comma-Separated Value File

Use this code to create a comma-separated value (CSV) file from a recordset based on a SQL query. A number of applications, including Excel and Access, can read CSV files: Function CSVExport(sSQL As String, sDest As _ String) As BooleanOn Error goto Err_Handler Set snpExport = db.OpenRecordset(sSQL, dbOpenSnapshot) Open App.Path

C/C++ Linking

Question: If I make a C++ library and supply it to a clientwho does not have a C++ compiler, can theycall my C++ functions from their C routines?That is, is it possible to use the C++ library without having a C++ compiler installed (on UNIIX). Answer: It is possible to

int and class defination

Question: Why is int 2 bytes with real mode compilers, but 4 bytes with protected mode compilers? And why is the class defination ended with ;-mark, since other definations aren’t? Answer: Actually, integers are 2 bytes in 16-bit compilers and 4 bytes in 32-bit compilers. It represents the efficient data

Windows sound programming.

Question: When writing a Windows 95 program using VC++, how do you play a MIDI sound file? Answer: Musical Instrument Digital Interface (MIDI) is a standard used by electronic keyboards long before Microsoft developed Windows. MIDI defines a protocol for transmitting and storing musical information. The Win32 API provides several

Terminate and Stay Resident Programs

Question: Can you supply me with boilerplate code for a simple console tsr program? I’m using VC++ 4.0, and I want to create a console program to check a directory every five minutes and delete zf*.* files. I don’t know if Windows NT has an event activator to fire this

Static initialization and free store

Question: Is it valid to attempt to allocate (via ‘new()’) dynamic memory prior to ‘main()’? I am working on software that has static *’s to class objects, and through some rather nasty macro expansion, these object ptrs attempt to instantiate themselves via the ‘new()’ operator. I am working on Irix

Learning Visual C++ — Coming from Basic backgrd!

Question: Coming from a Basic/Visual Basic background, how hard is it for one to transition to Visual C++? Can I transition without, first, learning C itself? What books would you recommend to help with this transition process (if any)? Answer: Coming from VB to VC can be difficult. The more

No more posts to show