Click here to Skip to main content
15,891,253 members
Articles / Programming Languages / C

COM in plain C, Part 7

Rate me:
Please Sign up or sign in to vote.
5.00/5 (15 votes)
8 Aug 2006CPOL13 min read 93.5K   2K   83  
An ActiveX Script Host with custom COM objects. This allows a script to call C functions in your app.
// Defines our GUIDs for our own objects, and the object name a
// script uses to call our application object's extra functions.
//
// You must use GUIDGEN.EXE to generate your own GUIDs when you
// create your own script host.

#include <initguid.h>

// Our IApp object GUID
const CLSID CLSID_IApp = {0xCD19DEC3,0x3B5A,0x11d0,{0xB3,0x9A,0x00,0x80,0xC7,0xBC,0x78,0x84}};

// Our IApp VTable's GUID
const IID IID_IApp = {0xCD19DEC1,0x3B5A,0x11d0,{0xB3,0x9A,0x00,0x80,0xC7,0xBC,0x78,0x84}};

// Our IDocument VTable's GUID
const IID IID_IDocument = {0xB1EADC36,0x21A0,0x4766,{0x91,0x42,0x74,0x5F,0x60,0x56,0x61,0x45}};

// The name that a script uses to access our application object
const wchar_t	MyAppObjectName[] =	L"application";

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
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions