Eugène Bindels
Eugène Bindels

Reputation: 45

Generating C++ com interface for microsoft word using midl compiler

I'm trying to create the microsoft word COM C++ interface definition using the midl compiler. I used oleview.exe to save the "Microsoft Word 14.0 Object Library" (MSWORD.OLB) to a file called MSWORD.idl.

When compiling this idl file I get errors. For instance:

.\msword.idl(3932) : error MIDL2025 : syntax error : expecting a type specification near "single"

I have fixed this by:

typedef float single;

Then the next error is displayed:

.\msword.idl(4004) : error MIDL2025 : syntax error : expecting a type specification near "WdDocumentMedium"

The lines around 4004:

[id(0x0000019e), helpcontext(0x0970019e)]
HRESULT SetDefaultTheme(
                        [in] BSTR Name, 
                        [in] WdDocumentMedium DocumentType);

WdDocumentMedium is defined as an enum but after this line.

Another undefined enum is MsoLanguageID.

Using the visual basic editor inside word, I have checked the necessary libraries using the object browser.

Upvotes: 0

Views: 372

Answers (0)

Related Questions