Click here to Skip to main content
15,885,216 members
Articles / Programming Languages / Visual Basic

Building COM Components Using MATLAB - Part I

Rate me:
Please Sign up or sign in to vote.
3.28/5 (15 votes)
27 Feb 20046 min read 274.6K   2K   46  
Building COM components that can be called from any IDEs that support COM with MATLAB COMBuilder toolbox
/* this ALWAYS GENERATED file contains the definitions for the interfaces */


/* File created by MIDL compiler version 5.01.0164 */
/* at Sat Feb 28 16:18:03 2004
 */
/* Compiler settings for G:/MATLAB/work/Fourier/src\fourier_idl.idl:
    Os (OptLev=s), W1, Zp8, env=Win32, ms_ext, c_ext
    error checks: allocation ref bounds_check enum stub_data 
*/
//@@MIDL_FILE_HEADING(  )


/* 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 __fourier_idl_h__
#define __fourier_idl_h__

#ifdef __cplusplus
extern "C"{
#endif 

/* Forward Declarations */ 

#ifndef __IFourier_FWD_DEFINED__
#define __IFourier_FWD_DEFINED__
typedef interface IFourier IFourier;
#endif 	/* __IFourier_FWD_DEFINED__ */


#ifndef __Fourier_FWD_DEFINED__
#define __Fourier_FWD_DEFINED__

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

#endif 	/* __Fourier_FWD_DEFINED__ */


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

void __RPC_FAR * __RPC_USER MIDL_user_allocate(size_t);
void __RPC_USER MIDL_user_free( void __RPC_FAR * ); 

#ifndef __IFourier_INTERFACE_DEFINED__
#define __IFourier_INTERFACE_DEFINED__

/* interface IFourier */
/* [unique][helpstring][dual][uuid][object] */ 


EXTERN_C const IID IID_IFourier;

#if defined(__cplusplus) && !defined(CINTERFACE)
    
    MIDL_INTERFACE("8EA045CF-C283-4297-9F67-087148721FC9")
    IFourier : public IDispatch
    {
    public:
        virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_MWFlags( 
            /* [retval][out] */ IMWFlags __RPC_FAR *__RPC_FAR *ppvFlags) = 0;
        
        virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_MWFlags( 
            /* [in] */ IMWFlags __RPC_FAR *pvFlags) = 0;
        
        virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE addnoise( 
            /* [in] */ long nargout,
            /* [out][in] */ VARIANT __RPC_FAR *n) = 0;
        
        virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE powerspectrum( 
            /* [in] */ long nargout,
            /* [out][in] */ VARIANT __RPC_FAR *m) = 0;
        
        virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_x( 
            /* [retval][out] */ VARIANT __RPC_FAR *x) = 0;
        
        virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_x( 
            /* [in] */ VARIANT x) = 0;
        
        virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_y( 
            /* [retval][out] */ VARIANT __RPC_FAR *y) = 0;
        
        virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_y( 
            /* [in] */ VARIANT y) = 0;
        
    };
    
#else 	/* C style interface */

    typedef struct IFourierVtbl
    {
        BEGIN_INTERFACE
        
        HRESULT ( STDMETHODCALLTYPE __RPC_FAR *QueryInterface )( 
            IFourier __RPC_FAR * This,
            /* [in] */ REFIID riid,
            /* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject);
        
        ULONG ( STDMETHODCALLTYPE __RPC_FAR *AddRef )( 
            IFourier __RPC_FAR * This);
        
        ULONG ( STDMETHODCALLTYPE __RPC_FAR *Release )( 
            IFourier __RPC_FAR * This);
        
        HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetTypeInfoCount )( 
            IFourier __RPC_FAR * This,
            /* [out] */ UINT __RPC_FAR *pctinfo);
        
        HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetTypeInfo )( 
            IFourier __RPC_FAR * This,
            /* [in] */ UINT iTInfo,
            /* [in] */ LCID lcid,
            /* [out] */ ITypeInfo __RPC_FAR *__RPC_FAR *ppTInfo);
        
        HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetIDsOfNames )( 
            IFourier __RPC_FAR * This,
            /* [in] */ REFIID riid,
            /* [size_is][in] */ LPOLESTR __RPC_FAR *rgszNames,
            /* [in] */ UINT cNames,
            /* [in] */ LCID lcid,
            /* [size_is][out] */ DISPID __RPC_FAR *rgDispId);
        
        /* [local] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *Invoke )( 
            IFourier __RPC_FAR * This,
            /* [in] */ DISPID dispIdMember,
            /* [in] */ REFIID riid,
            /* [in] */ LCID lcid,
            /* [in] */ WORD wFlags,
            /* [out][in] */ DISPPARAMS __RPC_FAR *pDispParams,
            /* [out] */ VARIANT __RPC_FAR *pVarResult,
            /* [out] */ EXCEPINFO __RPC_FAR *pExcepInfo,
            /* [out] */ UINT __RPC_FAR *puArgErr);
        
        /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_MWFlags )( 
            IFourier __RPC_FAR * This,
            /* [retval][out] */ IMWFlags __RPC_FAR *__RPC_FAR *ppvFlags);
        
        /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_MWFlags )( 
            IFourier __RPC_FAR * This,
            /* [in] */ IMWFlags __RPC_FAR *pvFlags);
        
        /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *addnoise )( 
            IFourier __RPC_FAR * This,
            /* [in] */ long nargout,
            /* [out][in] */ VARIANT __RPC_FAR *n);
        
        /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *powerspectrum )( 
            IFourier __RPC_FAR * This,
            /* [in] */ long nargout,
            /* [out][in] */ VARIANT __RPC_FAR *m);
        
        /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_x )( 
            IFourier __RPC_FAR * This,
            /* [retval][out] */ VARIANT __RPC_FAR *x);
        
        /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_x )( 
            IFourier __RPC_FAR * This,
            /* [in] */ VARIANT x);
        
        /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_y )( 
            IFourier __RPC_FAR * This,
            /* [retval][out] */ VARIANT __RPC_FAR *y);
        
        /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_y )( 
            IFourier __RPC_FAR * This,
            /* [in] */ VARIANT y);
        
        END_INTERFACE
    } IFourierVtbl;

    interface IFourier
    {
        CONST_VTBL struct IFourierVtbl __RPC_FAR *lpVtbl;
    };

    

#ifdef COBJMACROS


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

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

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


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

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

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

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


#define IFourier_get_MWFlags(This,ppvFlags)	\
    (This)->lpVtbl -> get_MWFlags(This,ppvFlags)

#define IFourier_put_MWFlags(This,pvFlags)	\
    (This)->lpVtbl -> put_MWFlags(This,pvFlags)

#define IFourier_addnoise(This,nargout,n)	\
    (This)->lpVtbl -> addnoise(This,nargout,n)

#define IFourier_powerspectrum(This,nargout,m)	\
    (This)->lpVtbl -> powerspectrum(This,nargout,m)

#define IFourier_get_x(This,x)	\
    (This)->lpVtbl -> get_x(This,x)

#define IFourier_put_x(This,x)	\
    (This)->lpVtbl -> put_x(This,x)

#define IFourier_get_y(This,y)	\
    (This)->lpVtbl -> get_y(This,y)

#define IFourier_put_y(This,y)	\
    (This)->lpVtbl -> put_y(This,y)

#endif /* COBJMACROS */


#endif 	/* C style interface */



/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IFourier_get_MWFlags_Proxy( 
    IFourier __RPC_FAR * This,
    /* [retval][out] */ IMWFlags __RPC_FAR *__RPC_FAR *ppvFlags);


void __RPC_STUB IFourier_get_MWFlags_Stub(
    IRpcStubBuffer *This,
    IRpcChannelBuffer *_pRpcChannelBuffer,
    PRPC_MESSAGE _pRpcMessage,
    DWORD *_pdwStubPhase);


/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IFourier_put_MWFlags_Proxy( 
    IFourier __RPC_FAR * This,
    /* [in] */ IMWFlags __RPC_FAR *pvFlags);


void __RPC_STUB IFourier_put_MWFlags_Stub(
    IRpcStubBuffer *This,
    IRpcChannelBuffer *_pRpcChannelBuffer,
    PRPC_MESSAGE _pRpcMessage,
    DWORD *_pdwStubPhase);


/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IFourier_addnoise_Proxy( 
    IFourier __RPC_FAR * This,
    /* [in] */ long nargout,
    /* [out][in] */ VARIANT __RPC_FAR *n);


void __RPC_STUB IFourier_addnoise_Stub(
    IRpcStubBuffer *This,
    IRpcChannelBuffer *_pRpcChannelBuffer,
    PRPC_MESSAGE _pRpcMessage,
    DWORD *_pdwStubPhase);


/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IFourier_powerspectrum_Proxy( 
    IFourier __RPC_FAR * This,
    /* [in] */ long nargout,
    /* [out][in] */ VARIANT __RPC_FAR *m);


void __RPC_STUB IFourier_powerspectrum_Stub(
    IRpcStubBuffer *This,
    IRpcChannelBuffer *_pRpcChannelBuffer,
    PRPC_MESSAGE _pRpcMessage,
    DWORD *_pdwStubPhase);


/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IFourier_get_x_Proxy( 
    IFourier __RPC_FAR * This,
    /* [retval][out] */ VARIANT __RPC_FAR *x);


void __RPC_STUB IFourier_get_x_Stub(
    IRpcStubBuffer *This,
    IRpcChannelBuffer *_pRpcChannelBuffer,
    PRPC_MESSAGE _pRpcMessage,
    DWORD *_pdwStubPhase);


/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IFourier_put_x_Proxy( 
    IFourier __RPC_FAR * This,
    /* [in] */ VARIANT x);


void __RPC_STUB IFourier_put_x_Stub(
    IRpcStubBuffer *This,
    IRpcChannelBuffer *_pRpcChannelBuffer,
    PRPC_MESSAGE _pRpcMessage,
    DWORD *_pdwStubPhase);


/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IFourier_get_y_Proxy( 
    IFourier __RPC_FAR * This,
    /* [retval][out] */ VARIANT __RPC_FAR *y);


void __RPC_STUB IFourier_get_y_Stub(
    IRpcStubBuffer *This,
    IRpcChannelBuffer *_pRpcChannelBuffer,
    PRPC_MESSAGE _pRpcMessage,
    DWORD *_pdwStubPhase);


/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IFourier_put_y_Proxy( 
    IFourier __RPC_FAR * This,
    /* [in] */ VARIANT y);


void __RPC_STUB IFourier_put_y_Stub(
    IRpcStubBuffer *This,
    IRpcChannelBuffer *_pRpcChannelBuffer,
    PRPC_MESSAGE _pRpcMessage,
    DWORD *_pdwStubPhase);



#endif 	/* __IFourier_INTERFACE_DEFINED__ */



#ifndef __Fourier_LIBRARY_DEFINED__
#define __Fourier_LIBRARY_DEFINED__

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


EXTERN_C const IID LIBID_Fourier;

EXTERN_C const CLSID CLSID_Fourier;

#ifdef __cplusplus

class DECLSPEC_UUID("9C1BB35A-1147-4A61-8533-FAC799B3D200")
Fourier;
#endif
#endif /* __Fourier_LIBRARY_DEFINED__ */

/* Additional Prototypes for ALL interfaces */

unsigned long             __RPC_USER  VARIANT_UserSize(     unsigned long __RPC_FAR *, unsigned long            , VARIANT __RPC_FAR * ); 
unsigned char __RPC_FAR * __RPC_USER  VARIANT_UserMarshal(  unsigned long __RPC_FAR *, unsigned char __RPC_FAR *, VARIANT __RPC_FAR * ); 
unsigned char __RPC_FAR * __RPC_USER  VARIANT_UserUnmarshal(unsigned long __RPC_FAR *, unsigned char __RPC_FAR *, VARIANT __RPC_FAR * ); 
void                      __RPC_USER  VARIANT_UserFree(     unsigned long __RPC_FAR *, VARIANT __RPC_FAR * ); 

/* 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 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
CEO Solaris Electronics LLC
United Arab Emirates United Arab Emirates
I was born in Shiraz, a very beautiful famous city in Iran. I started programming when I was 12 years old with GWBASIC. Since now, I worked with various programming languages from Basic, Foxpro, C/C++, Visual Basic, Pascal to MATLAB and now Visual C++.
I graduated from Iran University of Science & Technology in Communication Eng., and now work as a system programmer for a telecommunication industry.
I wrote several programs and drivers for Synthesizers, Power Amplifiers, GPIB, GPS devices, Radio cards, Data Acquisition cards and so many related devices.
I'm author of several books like Learning C (primary and advanced), Learning Visual Basic, API application for VB, Teach Yourself Object Oriented Programming (OOP) and etc.
I'm winner of January, May, August 2003 and April 2005 best article of month competition, my articles are:


You can see list of my articles, by clicking here


Comments and Discussions