Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

Customized Visual Studio .NET package: your fully integrated document window inside the IDE

, 20 Dec 2003
Create a fully integrated document window inside the Visual Studio IDE.
/**********************************************************************
- File Name: vspackage.h
- Date: 12/7/2003 6:14:19 PM
- Author: Michael Sheinin
- Description : 
	Declaration of the IVsPackage interface based on typelib info found
	in bined.dll (or OLEView.exe utility)
	Declaration of the CVsPackege class, implementing IVsPackage wrapper
	for a real object returned by the original IClassFactory object
- Notes: 

**********************************************************************/
#pragma once

#include <unknwn.h>


// forward declarartions
interface _VSPROPSHEETPAGE;
interface IServiceProvider;

// GUID is taken from registry
static const GUID	IID_IVsPackage={0xD4F3F4B1,0xE900,0x4E51,0xAD,0xB3,0xD5,0x32,0x34,0x8F,0x83,0xCB};

// Declaration if the interface
interface IVsPackage : public IUnknown
{
	virtual STDMETHODIMP SetSite( IServiceProvider* pSP ) = 0;
	virtual STDMETHODIMP QueryClose(long* pfCanClose) = 0;
	virtual STDMETHODIMP Close() = 0;
	virtual STDMETHODIMP GetAutomationObject(LPWSTR pszPropName, IDispatch** ppDisp) = 0;
	virtual STDMETHODIMP CreateTool(GUID* rguidPersistenceSlot) = 0;
	virtual STDMETHODIMP ResetDefaults(unsigned long grfFlags) = 0;
	virtual STDMETHODIMP GetPropertyPage(GUID* rguidPage, _VSPROPSHEETPAGE* ppage) = 0;
};

class CServiceProvider;

class CVsPackage : public IVsPackage
{
public:
	CVsPackage(void);
	~CVsPackage(void);
	BOOL Attach( IVsPackage* pVP );
	// IUnknown
	STDMETHODIMP QueryInterface( REFIID, LPVOID* );
	STDMETHODIMP_(ULONG) AddRef(void);
	STDMETHODIMP_(ULONG) Release(void);
	// IVsPackage
	STDMETHODIMP SetSite( IServiceProvider* pSP );
	STDMETHODIMP QueryClose(long* pfCanClose);
	STDMETHODIMP Close();
	STDMETHODIMP GetAutomationObject(LPWSTR pszPropName, IDispatch** ppDisp);
	STDMETHODIMP CreateTool(GUID* rguidPersistenceSlot);
	STDMETHODIMP ResetDefaults(unsigned long grfFlags);
	STDMETHODIMP GetPropertyPage(GUID* rguidPage, _VSPROPSHEETPAGE* ppage);
protected:
	IVsPackage* m_pRealObject;
	CServiceProvider*	m_pServiceProvider;
};

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

Share

About the Author

Michael Sheinin
Web Developer
United States United States
For the last 7 years I have developed software in real-time/embedded and MS-Windows environments for military and civil markets. I hold B.Sc. degree in computer engineering. Living in Ontario, Canada, I like hiking and traveling in general. Currently, I'm looking for employment opportunity inside the GTA.

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.141223.1 | Last Updated 21 Dec 2003
Article Copyright 2003 by Michael Sheinin
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid