Click here to Skip to main content
15,886,799 members
Articles / Hosted Services / Azure

Automating Windows Applications Using Azure AppFabric Service Bus

Rate me:
Please Sign up or sign in to vote.
4.93/5 (38 votes)
13 Nov 2010CPOL8 min read 46.9K   1.3K   49  
Unmanaged Windows GUI application with no exported program interface gets automated with injected code. A WCF aware injected component allows world-wide located clients to communicate with automated application via Azure AppFabric Service Bus despite firewalls and dynamic IP addresses

/* this ALWAYS GENERATED file contains the definitions for the interfaces */


 /* File created by MIDL compiler version 7.00.0555 */
/* at Sun Nov 07 22:50:33 2010
 */
/* Compiler settings for Injector.idl:
    Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 7.00.0555 
    protocol : dce , ms_ext, c_ext
    error checks: allocation ref bounds_check enum stub_data 
    VC __declspec() decoration level: 
         __declspec(uuid()), __declspec(selectany), __declspec(novtable)
         DECLSPEC_UUID(), MIDL_INTERFACE()
*/
/* @@MIDL_FILE_HEADING(  ) */

#pragma warning( disable: 4049 )  /* more than 64k source lines */


/* verify that the <rpcndr.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCNDR_H_VERSION__
#define __REQUIRED_RPCNDR_H_VERSION__ 440
#endif

#include "rpc.h"
#include "rpcndr.h"

#ifndef __RPCNDR_H_VERSION__
#error this stub requires an updated version of <rpcndr.h>
#endif // __RPCNDR_H_VERSION__

#ifndef COM_NO_WINDOWS_H
#include "windows.h"
#include "ole2.h"
#endif /*COM_NO_WINDOWS_H*/

#ifndef __Injector_h__
#define __Injector_h__

#if defined(_MSC_VER) && (_MSC_VER >= 1020)
#pragma once
#endif

/* Forward Declarations */ 

#ifndef __IInjHelper_FWD_DEFINED__
#define __IInjHelper_FWD_DEFINED__
typedef interface IInjHelper IInjHelper;
#endif 	/* __IInjHelper_FWD_DEFINED__ */


#ifndef __InjHelper_FWD_DEFINED__
#define __InjHelper_FWD_DEFINED__

#ifdef __cplusplus
typedef class InjHelper InjHelper;
#else
typedef struct InjHelper InjHelper;
#endif /* __cplusplus */

#endif 	/* __InjHelper_FWD_DEFINED__ */


/* header files for imported files */
#include "oaidl.h"
#include "ocidl.h"

#ifdef __cplusplus
extern "C"{
#endif 


#ifndef __IInjHelper_INTERFACE_DEFINED__
#define __IInjHelper_INTERFACE_DEFINED__

/* interface IInjHelper */
/* [unique][helpstring][nonextensible][dual][uuid][object] */ 


EXTERN_C const IID IID_IInjHelper;

#if defined(__cplusplus) && !defined(CINTERFACE)
    
    MIDL_INTERFACE("21619E95-EA02-47E5-B470-D76A9FB6E6CC")
    IInjHelper : public IDispatch
    {
    public:
        virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Run( 
            /* [in] */ BSTR bsTargetPath,
            /* [in] */ BSTR bsPluginPath,
            /* [in] */ BSTR bsTargetWndClass) = 0;
        
    };
    
#else 	/* C style interface */

    typedef struct IInjHelperVtbl
    {
        BEGIN_INTERFACE
        
        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( 
            IInjHelper * This,
            /* [in] */ REFIID riid,
            /* [annotation][iid_is][out] */ 
            __RPC__deref_out  void **ppvObject);
        
        ULONG ( STDMETHODCALLTYPE *AddRef )( 
            IInjHelper * This);
        
        ULONG ( STDMETHODCALLTYPE *Release )( 
            IInjHelper * This);
        
        HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( 
            IInjHelper * This,
            /* [out] */ UINT *pctinfo);
        
        HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( 
            IInjHelper * This,
            /* [in] */ UINT iTInfo,
            /* [in] */ LCID lcid,
            /* [out] */ ITypeInfo **ppTInfo);
        
        HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( 
            IInjHelper * This,
            /* [in] */ REFIID riid,
            /* [size_is][in] */ LPOLESTR *rgszNames,
            /* [range][in] */ UINT cNames,
            /* [in] */ LCID lcid,
            /* [size_is][out] */ DISPID *rgDispId);
        
        /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( 
            IInjHelper * This,
            /* [in] */ DISPID dispIdMember,
            /* [in] */ REFIID riid,
            /* [in] */ LCID lcid,
            /* [in] */ WORD wFlags,
            /* [out][in] */ DISPPARAMS *pDispParams,
            /* [out] */ VARIANT *pVarResult,
            /* [out] */ EXCEPINFO *pExcepInfo,
            /* [out] */ UINT *puArgErr);
        
        /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Run )( 
            IInjHelper * This,
            /* [in] */ BSTR bsTargetPath,
            /* [in] */ BSTR bsPluginPath,
            /* [in] */ BSTR bsTargetWndClass);
        
        END_INTERFACE
    } IInjHelperVtbl;

    interface IInjHelper
    {
        CONST_VTBL struct IInjHelperVtbl *lpVtbl;
    };

    

#ifdef COBJMACROS


#define IInjHelper_QueryInterface(This,riid,ppvObject)	\
    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) 

#define IInjHelper_AddRef(This)	\
    ( (This)->lpVtbl -> AddRef(This) ) 

#define IInjHelper_Release(This)	\
    ( (This)->lpVtbl -> Release(This) ) 


#define IInjHelper_GetTypeInfoCount(This,pctinfo)	\
    ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) 

#define IInjHelper_GetTypeInfo(This,iTInfo,lcid,ppTInfo)	\
    ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) 

#define IInjHelper_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)	\
    ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) 

#define IInjHelper_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)	\
    ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) 


#define IInjHelper_Run(This,bsTargetPath,bsPluginPath,bsTargetWndClass)	\
    ( (This)->lpVtbl -> Run(This,bsTargetPath,bsPluginPath,bsTargetWndClass) ) 

#endif /* COBJMACROS */


#endif 	/* C style interface */




#endif 	/* __IInjHelper_INTERFACE_DEFINED__ */



#ifndef __InjectorLib_LIBRARY_DEFINED__
#define __InjectorLib_LIBRARY_DEFINED__

/* library InjectorLib */
/* [helpstring][version][uuid] */ 


EXTERN_C const IID LIBID_InjectorLib;

EXTERN_C const CLSID CLSID_InjHelper;

#ifdef __cplusplus

class DECLSPEC_UUID("AB6DEF58-5546-4BB8-BB2F-6E30E021BD22")
InjHelper;
#endif
#endif /* __InjectorLib_LIBRARY_DEFINED__ */

/* Additional Prototypes for ALL interfaces */

unsigned long             __RPC_USER  BSTR_UserSize(     unsigned long *, unsigned long            , BSTR * ); 
unsigned char * __RPC_USER  BSTR_UserMarshal(  unsigned long *, unsigned char *, BSTR * ); 
unsigned char * __RPC_USER  BSTR_UserUnmarshal(unsigned long *, unsigned char *, BSTR * ); 
void                      __RPC_USER  BSTR_UserFree(     unsigned long *, BSTR * ); 

/* end of Additional Prototypes */

#ifdef __cplusplus
}
#endif

#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, 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