Click here to Skip to main content
11,485,294 members (78,191 online)
Click here to Skip to main content
Add your own
alternative version

Using COM Objects in Scripting Languages -- Part 2 (Python)

, 20 Apr 2010 CPOL 26.9K 332 25
This article shows how to instantiate a COM object in Python and use its methods and properties.

/* this ALWAYS GENERATED file contains the IIDs and CLSIDs */

/* link this file in with the server and any clients */

 /* File created by MIDL compiler version 7.00.0555 */
/* at Thu Apr 15 19:33:34 2010
/* Compiler settings for .\SimpleCOM.idl:
    Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 7.00.0555 
    protocol : dce , ms_ext, c_ext, robust
    error checks: stub_data 
    VC __declspec() decoration level: 
         __declspec(uuid()), __declspec(selectany), __declspec(novtable)

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

#ifdef __cplusplus
extern "C"{

#include <rpc.h>
#include <rpcndr.h>


#ifndef INITGUID
#define INITGUID
#include <guiddef.h>
#include <guiddef.h>

#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \

#else // !_MIDL_USE_GUIDDEF_

#ifndef __IID_DEFINED__
#define __IID_DEFINED__

typedef struct _IID
    unsigned long x;
    unsigned short s1;
    unsigned short s2;
    unsigned char  c[8];
} IID;

#endif // __IID_DEFINED__

typedef IID CLSID;

#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \
        const type name = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}}


MIDL_DEFINE_GUID(IID, IID_IColor,0x3B83ACE6,0xD890,0x4cff,0x8C,0xDF,0xAC,0x6C,0x41,0xA7,0x8E,0x78);

MIDL_DEFINE_GUID(IID, IID_IPoint,0x60706484,0x8A6F,0x409b,0x8D,0xCE,0x7C,0x14,0xDC,0xAB,0xC8,0xE3);

MIDL_DEFINE_GUID(IID, IID_IGraphicPoint,0x2FF6CB42,0x0C57,0x455D,0x9A,0x7E,0x2C,0xE1,0xE7,0x4F,0x77,0x5B);

MIDL_DEFINE_GUID(IID, LIBID_SimpleCOMLib,0xFA3BF2A2,0x7220,0x47ED,0x8F,0x07,0xD1,0x54,0xB6,0x5A,0xA0,0x31);

MIDL_DEFINE_GUID(CLSID, CLSID_GraphicPoint,0x33E1D707,0xB576,0x4D3F,0xB7,0x6D,0x64,0x4D,0x2A,0x20,0xE9,0x42);


#ifdef __cplusplus

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.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Engineer Tata Technologies Ltd
India India
Sharjith is a Mechanical Engineer with strong passion for Automobiles, Aircrafts and Software development.

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.150520.1 | Last Updated 20 Apr 2010
Article Copyright 2010 by Sharjith
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid