Home Library Index Site Map  Links Search About

Example Win32 A.P.I. code

Source Code Example using Win32 A.P.I. date routine
 

 

 

apidate.cpp

#ifndef _APIDate_DRV_
#define _APIDate_DRV_

// INCLUDES
//
#include
#include

//========================================================

//	NAME:		APIDate.CPP -
// 	TYPE: 		C++ SOURCE FILE
//	SYNOPSIS:     	Example of using System date 
//			(console app )	
//	DESCRIPTION:  	DRIVER FILE FOR APIDate
//	EXAMPLES:
//	BUGS:
//	SEE ALSO:
////////////////////////////////////////////

void main()
{
  SYSTEMTIME* pSt = new SYSTEMTIME;

  GetSystemTime( pSt );



  cout<<"Todays date is:";
switch(pSt->wDay)
{
	case 0	: cout<<"Sunday";  break;
	case 1	: cout<<"Monday";  break;
	case 2	: cout<<"Tuesday";  break;
	case 3	: cout<<"Wednesday";  break;
	case 4	: cout<<"Thursday";  break;
	case 5	: cout<<"Friday";  break;
	case 6	: cout<<"Saturday";  break;
   default 	: cout<<"Error";  break;
}

  cout<<" the "<<	pSt->wDay	
      <<" of "	<<	pSt->wMonth
      <<"  "	<<	pSt->wYear;

  cout<<"\nPress any key to exit... ";
  while( !cin.get() )
	;

};

//========================================================

#endif _APIDate_DRV_
Home Library Index Top

STL Database
Arrays
Binary File Input / Output
Character Input
Containers
Standard Template Library
Streams
Templates
Utility Functions
Win32 Programming
Miscellaneous
 

 
copyright notice

Copyright Robert Mitchell. Last Revised : 2 October, 2000

e-mail me
Hosted by www.Geocities.ws

1