//
//	VCOM Client MenuMenuComamnd.cpp
//
//	Main entry point for VectorWorks Plug-in Menu Command code.
//
//	Copyright © Nemetschek North America, Inc  2005.
//	All Rights Reserved.


#include "StdAfx.h"

#include "Interfaces/IVCOMSampleInterface.h"



// Because we include MenuMain.cpp in the project, the low level setup operations
// are performed on our behalf by SDK code. The CallBackPtr is already stored in gCBP
// and can be used throughout this external

// See MiniCADHookIntf.h for a description


long MenuMain(long action, long message1, long& userData)
{
	switch (action) {
		case kMenuInitGlobals: {
				/*
					This action is called when an overlay is activated and serves the
					primary purpose of allowing the external function to define any
					defaults and global information and to initialize data space that
					may be stored in userData.
 				*/


				break;
			}
		case kMenuDisposeGlobals: {
				/*
					This action is called when a workspace is deactivated and serves
					the primary purpose of allowing the external function to dispose
					data space that may be stored in userData.
 				*/


				break;
			}
		case kMenuDoInterface: {
				VCOMError		vcomErr;

				VCOMPtr<IVCOMSample>	pSampleInst( IID_VCOMSample );
				if ( pSampleInst )  {
					vcomErr	= pSampleInst->Function();

					VCOMPtr<IVCOMSampleData>	pDataInst;
					if ( VCOM_SUCCEEDED( pSampleInst->GetData( & pDataInst ) ) ) {
						Uint32	dataValue	= 0;
						vcomErr				= pDataInst->Get( dataValue );

					}
				}

				break;
			}
	}

 	return 0L;
}

long DangerousMenuMain(long /*action*/, long /*message1*/, long & /*userData*/)
{
	// This entry point gets kMenuCheckHilite & kMenuNotify messages, which must be handled very carefully
	return 0L;
}
