Click here to Skip to main content
15,885,890 members
Articles / Desktop Programming / MFC

Be Sweet - a set of visual source code browsers

Rate me:
Please Sign up or sign in to vote.
4.85/5 (35 votes)
1 Jul 20038 min read 183.7K   4.9K   122  
A set of source code and project browsers to compliment Visual Studio.
// ESBDSAddinImpl.h : Declaration of the ESBDSAddinImpl

#ifndef __ESBDSADDIN_H_
#define __ESBDSADDIN_H_

#include "resource.h"       // main symbols
//#import "C:\Program Files\Development\Microsoft Visual Studio\Common\IDE\IDE98\DTE.TLB" raw_interfaces_only, raw_native_types, no_namespace, named_guids 

#include "EventHandler.h"
#include "CommandHandler.h"

#include "ESBServer/src/RemoteInterface/COM/IESBServer.h"

/////////////////////////////////////////////////////////////////////////////
// ESBDSAddinImpl
class ATL_NO_VTABLE ESBDSAddinImpl : 
	public CComObjectRootEx<CComSingleThreadModel>,
	public CComCoClass<ESBDSAddinImpl, &CLSID_ESBDSAddin>,
	public IDispatchImpl<IESBDSAddin, &IID_IESBDSAddin, &LIBID_ESBDSADDINLib>,
  public IDSAddIn
{
private:
  CComPtr<CommandHandler>	mCommandHandler;
  CComPtr<ApplicationEventHandler> mApplicationEventHandler;
  CComPtr<IApplication> mApplication;
  DWORD mClassRegistrationCookie;
  DWORD mCookie;
  bool  mIsEnabled;


public:
	ESBDSAddinImpl();

public:
  //IDSAddIn
	HResult OnConnection(IApplication* pApp, VARIANT_BOOL bFirstTime,	long dwCookie, VARIANT_BOOL* OnConnection);
	HResult OnDisconnection(VARIANT_BOOL bLastTime);

  // IESBDSAddInImpl
  HResult gotoLine(BSTR filename, long line);

  CComPtr<IApplication>& getApplication()
  { return mApplication; }

  CComPtr<ApplicationEventHandler>& getEventHandler()
  { return mApplicationEventHandler; }

  CComPtr<IESBServer> getESBServer();
  
  bool isEnabled() { return mIsEnabled; }
  void enable(bool e);

  void workspaceLoaded(const std::string &, const std::string &);
  void documentChanged(const std::string &);
  void documentActivated(const std::string &);

private:
  void setupComStuff();
  void setupAddIn(bool);

public:
  //the atl crap goes here
  DECLARE_REGISTRY_RESOURCEID(IDR_ESBDSADDIN)

  DECLARE_CLASSFACTORY_SINGLETON(ESBDSAddinImpl);

  BEGIN_COM_MAP(ESBDSAddinImpl)
	  COM_INTERFACE_ENTRY(IESBDSAddin)
    COM_INTERFACE_ENTRY(IDSAddIn)
	  COM_INTERFACE_ENTRY(IDispatch)
  END_COM_MAP()

};

#endif //__ESBDSADDIN_H_

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
Switzerland Switzerland
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions