Click here to Skip to main content
15,881,882 members
Articles / Programming Languages / C#

Automating Windows Applications

Rate me:
Please Sign up or sign in to vote.
4.95/5 (137 votes)
1 Feb 2003CPOL11 min read 392.1K   12.3K   309  
A Windows application that does not export any program interface, may be converted to automation server with COM object(s) injected into the application process.
// Advise.h

#if !defined __ADVISE_H__
#define __ADVISE_H__

#include "stdafx.h"

/////////////////////////////////////////////////////////////////////////////////////////
//	CAdvise 
//
class CAdvise
{
public:
	CAdvise(const IID& iidSinkInterface);
	~CAdvise();
	
	HRESULT AdviseToServer(IUnknown* pUnk, const IUnknown* pUnkEvents);
	void UnadviseToServer();

	DWORD GetCookie() const { return m_dwCookie; }

private:
	IID m_iidSinkInterface;
	CComPtr<IConnectionPoint> m_spCP; 
	DWORD m_dwCookie;
};

#endif // __ADVISE_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, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
Israel Israel


  • Nov 2010: Code Project Contests - Windows Azure Apps - Winner
  • Feb 2011: Code Project Contests - Windows Azure Apps - Grand Prize Winner



Comments and Discussions