Click here to Skip to main content
15,894,106 members
Articles / Desktop Programming / MFC

The Win32 Foundation Classes (WFC) - Version 45

Rate me:
Please Sign up or sign in to vote.
4.93/5 (40 votes)
16 May 2000 469.7K   12.7K   280  
The Win32 Foundation Classes (WFC) are a library of C++ classes that extend Microsoft Foundation Classes (MFC) beyond mere GUI applications, and provide extensive support for system and NT specific applications
#include <wfc.h>
#pragma hdrstop

/*
** Author: Samuel R. Blackburn
** Internet: wfc@pobox.com
**
** You can use it any way you like as long as you don't try to sell it.
**
** Any attempt to sell WFC in source code form must have the permission
** of the original author. You can produce commercial executables with
** WFC but you can't sell WFC.
**
** Copyright, 2000, Samuel R. Blackburn
**
** $Workfile: ATCP.cpp $
** $Revision: 17 $
** $Modtime: 1/04/00 5:09a $
** $Reuse Tracing Code: 1 $
*/

#if defined( _DEBUG ) && ! defined( WFC_STL )
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif // _DEBUG

#if ! defined(  WFC_NO_SERIALIZATION )
IMPLEMENT_SERIAL( CAppleTalkProjectionResult, CRemoteAccessServiceConnectionProjection, 1 )
#endif // WFC_NO_SERIALIZATION

#if defined( _DEBUG )
#define new DEBUG_NEW
#endif // _DEBUG

CAppleTalkProjectionResult::CAppleTalkProjectionResult()
{
   WFCLTRACEINIT( TEXT( "CAppleTalkProjectionResult::CAppleTalkProjectionResult()" ) );
   WFCTRACEVAL( TEXT( "pointer is " ), (VOID *) this );
   Empty();
}

CAppleTalkProjectionResult::CAppleTalkProjectionResult( const CAppleTalkProjectionResult& source )
{
   WFCLTRACEINIT( TEXT( "CAppleTalkProjectionResult( const CAppleTalkProjectionResult& )" ) );
   WFCTRACEVAL( TEXT( "pointer is " ), (VOID *) this );
   Empty();
   Copy( source );
}

CAppleTalkProjectionResult::CAppleTalkProjectionResult( const RAS_PPP_ATCP_RESULT * source )
{
   WFCLTRACEINIT( TEXT( "CAppleTalkProjectionResult( const RAS_PPP_ATCP_RESULT * )" ) );
   WFCTRACEVAL( TEXT( "pointer is " ), (VOID *) this );
   Empty();
   Copy( source );
}

CAppleTalkProjectionResult::~CAppleTalkProjectionResult()
{
   WFCLTRACEINIT( TEXT( "CAppleTalkProjectionResult::~CAppleTalkProjectionResult()" ) );
   WFCTRACEVAL( TEXT( "pointer is " ), (VOID *) this );
   Empty();
}

void CAppleTalkProjectionResult::Copy( const CAppleTalkProjectionResult& source )
{
   WFCLTRACEINIT( TEXT( "CAppleTalkProjectionResult::Copy( const CAppleTalkProjectionResult& )" ) );
   ErrorCode = source.ErrorCode;
   Address   = source.Address;
}

void CAppleTalkProjectionResult::Copy( const RAS_PPP_ATCP_RESULT * source )
{
   WFCLTRACEINIT( TEXT( "CAppleTalkProjectionResult::Copy( const RAS_PPP_ATCP_RESULT * )" ) );
   ASSERT( source != NULL );

   // Choose to live

   if ( source == NULL )
   {
      Empty();
      return;
   }

   // We were passed a pointer, do not trust it

   try
   {
      ErrorCode = source->dwError;
      ::wfc_convert_lpcwstr_to_cstring( source->wszAddress, Address );
   }
   catch( ... )
   {
      Empty();
      return;
   }
}

#if defined( _DEBUG ) && ! defined( WFC_NO_DUMPING )

void CAppleTalkProjectionResult::Dump( CDumpContext& dump_context ) const
{
   dump_context << TEXT( " a CAppleTalkProjectionResult at " ) << (VOID *) this << TEXT( "\n{\n" );
   CRemoteAccessServiceConnectionProjection::Dump( dump_context );
   dump_context << TEXT( "   Address is " ) << Address << TEXT( "\n" );
   dump_context << TEXT( "}\n" );
}

#endif

void CAppleTalkProjectionResult::Empty( void )
{
   WFCLTRACEINIT( TEXT( "CAppleTalkProjectionResult::Empty()" ) );
   CRemoteAccessServiceConnectionProjection::Empty();
   Address.Empty();
}

#if ! defined(  WFC_NO_SERIALIZATION )

void CAppleTalkProjectionResult::Serialize( CArchive& archive )
{
   WFCLTRACEINIT( TEXT( "CAppleTalkProjectionResult::Serialize()" ) );

   CRemoteAccessServiceConnectionProjection::Serialize( archive );

   if ( archive.IsStoring() )
   {
      WFCTRACE( TEXT( "Storing" ) );
      archive << Address;
   }
   else
   {
      WFCTRACE( TEXT( "Restoring" ) );
      archive >> Address;
   }
}

#endif // WFC_NO_SERIALIZATION

CAppleTalkProjectionResult& CAppleTalkProjectionResult::operator = ( const CAppleTalkProjectionResult& source )
{
   WFCLTRACEINIT( TEXT( "CAppleTalkProjectionResult::operator =()" ) );
   Copy( source );
   return( *this );
}

// End of source

#if 0
<HTML>

<HEAD>
<TITLE>WFC - CAppleTalkProjectionResult</TITLE>
<META name="keywords" content="WFC, MFC extension library, freeware class library, Win32, source code">
<META name="description" content="The C++ class that handles Appletalk RAS projection results.">
</HEAD>

<BODY>

<H1>CAppleTalkProjectionResult : CRemoteAccessServiceConnectionProjection</H1>
$Revision: 17 $
<HR>

<H2>Description</H2>

This class is based on the RAS_PPP_ATCP_RESULT structure.

<H2>Data Members</H2>

<B>Address</B> - Contains the address.

<H2>Methods</H2>

<DL COMPACT>

<DT><B>Copy</B><DD>Copies another CAppleTalkProjectionResult or a RAS_PPP_ATCP_RESULT structure.
<DT><B>Empty</B><DD>Clears all data members.
<DT><B>Serialize</B><DD>After all, we are a CObject...

</DL>

<H2>Example</H2><PRE><CODE>Sorry.</CODE></PRE>

<HR><I>Copyright, 2000, <A HREF="mailto:wfc@pobox.com">Samuel R. Blackburn</A></I><BR>
$Workfile: ATCP.cpp $<BR>
$Modtime: 1/04/00 5:09a $
</BODY>

</HTML>
#endif

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
United States United States
I'm just a simple little NT programmer. Most of the work I do is remote controlling equipment in real time. I started out using Windows 3.0. Then came 3.1 and then NT. I started using NT but unfortunately, Microsoft didn't. I started using MFC but unfortunately, Microsoft didn't (and still doesn't) put any real support for NT into MFC so I wrote a bunch of C++ classes to make my life easier. Like all class libraries, mine grew. Now I'm giving it away, I call it Win32 Foundation Classes.

Check out Sam's homepage at www.SamBlackburn.com/wfc/.

Comments and Discussions