Windows/Visual C++ Samples

Name

Date Size Platform
WRITERES.ZIP 11 December, 1999 579568 Windows XP, Windows 2000
This console application shows how to bake resources into console applications. The sample also demonstrates using FindResource(), LockResource(), FreeResource(), and SizeofResource() APIs to access the bytes in the image resources directly. The sample uses an ofstream and a stdio FILE to write the bytes of the resource out to new files.      
       
PRIMECON.ZIP   60888 Windows XP, Windows 2000
PrimeCon is a VC++ 6.0 sample which uses MFC in a console application. This executable spins off one thread which works at finding prime numbers. The thread uses PostThreadMessage() to notify another thread about the primes that it has found. The secondary thread owns and displays a dialog box. When a prime is found, the console thread uses printf() to show the prime found, while the dialog lists all the founds prime numbers in a list box. The sample shows the proper use of MFC in a console application, and further demonstrates the use of custom thread messages and the creation of graphical user interface components from a /SUBSYSTEM:CONSOLE application.      
       
Q1.ZIP 16 November, 1999 79910 Windows XP, Windows 2000
Q1 is a VC++ 6.0 project that creates two threads. The first thread does not have a message queue. The main thread tries to send the first thread a message, and shows that the return from the PostThreadMessage() API is FALSE in that situation. The app creates a second thread that does have a message queue. The main thread shows that PostThreadMessage() does indeed return TRUE in that situation. This sample does not use MFC.