构建 MFC 自动化示例(使用 OLE 自动化访问 Excel)。 无法编译

发布于 2024-07-06 05:33:02 字数 3720 浏览 10 评论 0原文

我正在尝试构建 http://support.microsoft.com 中描述的示例/kb/178749/EN-US/,以便构建一个使用自动化以编程方式访问 Excel 的应用程序。 我有 Visual C++ 2005/Visual Studio 2005。有些指令并不完全匹配(大多数是类向导),但总体思路似乎是相同的。

问题:使用“新类”创建包装类后,我最终没有得到 excel.h 文件。 所以我不能按照步骤 13 中指定的方式 #include 该文件。我确实在我的 Windebug 目录中得到了一个 excel.tlh 和一个 excel.tli,但这似乎不起作用。 我尝试了所有命令

#include "stdafx.h"
#include "debug/excel.tli"
#include "debug/excel.tlh"

...包括将其中一个文件排除在编译之外,但最终仍然出现大量编译错误。

以下是上述 #include 的前 5 个编译错误:

1>c:\users\sniles\documents\visual studio 2005\source10\testole\testole\debug\excel.tli(14) : error C2653: 'Adjustments' : is not a class or namespace name
1>c:\users\sniles\documents\visual studio 2005\source10\testole\testole\debug\excel.tli(14) : error C2146: syntax error : missing ';' before identifier 'GetParent'
1>c:\users\sniles\documents\visual studio 2005\source10\testole\testole\debug\excel.tli(14) : error C2433: 'IDispatchPtr' : 'inline' not permitted on data declarations
1>c:\users\sniles\documents\visual studio 2005\source10\testole\testole\debug\excel.tli(14) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\users\sniles\documents\visual studio 2005\source10\testole\testole\debug\excel.tli(14) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\users\sniles\documents\visual studio 2005\source10\testole\testole\debug\excel.tli(16) : error C3861: 'get_Parent': identifier not found

这是这些包含的前 5 个错误:

#include "stdafx.h"
#include "debug/excel.tlh"

1>c:\users\sniles\documents\visual studio 2005\source10\testole\testole\debug\excel.tlh(550) : error C3121: cannot change GUID for class 'IFilter'
1>        c:\program files\microsoft sdks\windows\v6.0\include\comdef.h(483) : see declaration of 'IFilter'
1>c:\users\sniles\documents\visual studio 2005\source10\testole\testole\debug\excel.tlh(1541) : error C2786: 'BOOL (__stdcall *)(HDC,int,int,int,int)' : invalid operand for __uuidof
1>c:\users\sniles\documents\visual studio 2005\source10\testole\testole\debug\excel.tlh(1541) : error C2923: '_com_IIID' : 'Rectangle' is not a valid template type argument for parameter '_Interface'
1>        c:\program files\microsoft sdks\windows\v6.0\include\wingdi.h(3667) : see declaration of 'Rectangle'
1>c:\users\sniles\documents\visual studio 2005\source10\testole\testole\debug\excel.tlh(1541) : error C3203: '_com_IIID' : unspecialized class template can't be used as a template argument for template parameter '_IIID', expected a real type

这是这些包含的前 5 个错误:

#include "stdafx.h"
#include "debug/excel.tli"

1>c:\users\sniles\documents\visual studio 2005\source10\testole\testole\debug\excel.tli(14) : error C2653: 'Adjustments' : is not a class or namespace name
1>c:\users\sniles\documents\visual studio 2005\source10\testole\testole\debug\excel.tli(14) : error C2146: syntax error : missing ';' before identifier 'GetParent'
1>c:\users\sniles\documents\visual studio 2005\source10\testole\testole\debug\excel.tli(14) : error C2433: 'IDispatchPtr' : 'inline' not permitted on data declarations
1>c:\users\sniles\documents\visual studio 2005\source10\testole\testole\debug\excel.tli(14) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\users\sniles\documents\visual studio 2005\source10\testole\testole\debug\excel.tli(14) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

提前致谢。

I'm trying to build the example described at http://support.microsoft.com/kb/178749/EN-US/ in order to build an application that programatically accesses Excel using Automation. I have Visual C++ 2005/Visual Studio 2005. Some of the instructions don't exactly match up (classwizard, mostly), but the general idea seems to be the same.

Problems: I don't end up with an excel.h file after using the "new class" to create my wrapper classes. So I can' t #include that file as it specifies in step 13. I do get a excel.tlh and an excel.tli in my windebug directory, but that doesn't seem to work. I tried all orders for

#include "stdafx.h"
#include "debug/excel.tli"
#include "debug/excel.tlh"

... including leaving one of those files out of the compile, but I still end up with a ton of compile errors.

Here's the top 5 compile errors with the above #includes:

1>c:\users\sniles\documents\visual studio 2005\source10\testole\testole\debug\excel.tli(14) : error C2653: 'Adjustments' : is not a class or namespace name
1>c:\users\sniles\documents\visual studio 2005\source10\testole\testole\debug\excel.tli(14) : error C2146: syntax error : missing ';' before identifier 'GetParent'
1>c:\users\sniles\documents\visual studio 2005\source10\testole\testole\debug\excel.tli(14) : error C2433: 'IDispatchPtr' : 'inline' not permitted on data declarations
1>c:\users\sniles\documents\visual studio 2005\source10\testole\testole\debug\excel.tli(14) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\users\sniles\documents\visual studio 2005\source10\testole\testole\debug\excel.tli(14) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\users\sniles\documents\visual studio 2005\source10\testole\testole\debug\excel.tli(16) : error C3861: 'get_Parent': identifier not found

Here's the top 5 errors with these includes:

#include "stdafx.h"
#include "debug/excel.tlh"

1>c:\users\sniles\documents\visual studio 2005\source10\testole\testole\debug\excel.tlh(550) : error C3121: cannot change GUID for class 'IFilter'
1>        c:\program files\microsoft sdks\windows\v6.0\include\comdef.h(483) : see declaration of 'IFilter'
1>c:\users\sniles\documents\visual studio 2005\source10\testole\testole\debug\excel.tlh(1541) : error C2786: 'BOOL (__stdcall *)(HDC,int,int,int,int)' : invalid operand for __uuidof
1>c:\users\sniles\documents\visual studio 2005\source10\testole\testole\debug\excel.tlh(1541) : error C2923: '_com_IIID' : 'Rectangle' is not a valid template type argument for parameter '_Interface'
1>        c:\program files\microsoft sdks\windows\v6.0\include\wingdi.h(3667) : see declaration of 'Rectangle'
1>c:\users\sniles\documents\visual studio 2005\source10\testole\testole\debug\excel.tlh(1541) : error C3203: '_com_IIID' : unspecialized class template can't be used as a template argument for template parameter '_IIID', expected a real type

Here's the top 5 errors with these includes:

#include "stdafx.h"
#include "debug/excel.tli"

1>c:\users\sniles\documents\visual studio 2005\source10\testole\testole\debug\excel.tli(14) : error C2653: 'Adjustments' : is not a class or namespace name
1>c:\users\sniles\documents\visual studio 2005\source10\testole\testole\debug\excel.tli(14) : error C2146: syntax error : missing ';' before identifier 'GetParent'
1>c:\users\sniles\documents\visual studio 2005\source10\testole\testole\debug\excel.tli(14) : error C2433: 'IDispatchPtr' : 'inline' not permitted on data declarations
1>c:\users\sniles\documents\visual studio 2005\source10\testole\testole\debug\excel.tli(14) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\users\sniles\documents\visual studio 2005\source10\testole\testole\debug\excel.tli(14) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

违心° 2024-07-13 05:33:02

我不知道这是否有帮助,但通常您会 #import 类型库,但不会 #include .tli 和 .tlh 文件(#import 隐式执行此操作)。

另外,请记住在 MFC 中调用 COM 服务器有两种方法。

  1. 使用#import,它基本上创建智能ATL指针来创建COM对象并调用方法。

  2. 使用类向导创建 IDispatch 样式类包装器,以创建 COM 对象并调用方法。

I don't know if this helps but generally you #import the type library but you do NOT #include the .tli and .tlh files (the #import implicitly does this).

Also, remember there are two ways of calling a COM server in MFC.

  1. Use #import which basically creates smart ATL pointers to create COM objects and call methods.

  2. Use the class wizard to create an IDispatch style class wrapper to create COM object and call the methods.

唠甜嗑 2024-07-13 05:33:02

根据 Nick 的要求,我发布了构建错误输出,并遵循 vbe6ext.tlh 文件,直至出现错误:

********************* Build output:

1>------ Build started: Project: testole, Configuration: Debug Win32 ------
1>Compiling...
1>testoleDlg.cpp
1>c:\users\sniles\documents\visual studio 2005\source10\testole\testole\debug\vbe6ext.tlh(463) : error C2061: syntax error : identifier '__missing_type__'
1>c:\users\sniles\documents\visual studio 2005\source10\testole\testole\testoledlg.cpp(164) : error C2065: '_Application' : undeclared identifier
1>c:\users\sniles\documents\visual studio 2005\source10\testole\testole\testoledlg.cpp(164) : error C2146: syntax error : missing ';' before identifier 'app'
1>c:\users\sniles\documents\visual studio 2005\source10\testole\testole\testoledlg.cpp(164) : error C2065: 'app' : undeclared identifier
1>c:\users\sniles\documents\visual studio 2005\source10\testole\testole\testoledlg.cpp(166) : error C2228: left of '.CreateDispatch' must have class/struct/union
1>        type is ''unknown-type''
1>c:\users\sniles\documents\visual studio 2005\source10\testole\testole\testoledlg.cpp(172) : error C2228: left of '.SetVisible' must have class/struct/union
1>        type is ''unknown-type''
1>Build log was saved at "file://c:\Users\sniles\Documents\Visual Studio 2005\Source10\testole\testole\Debug\BuildLog.htm"
1>testole - 6 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

*******************  vbe6ext.tlh
// Created by Microsoft (R) C/C++ Compiler Version 14.00.50727.42 (e112bc16).
//
// c:\users\sniles\documents\visual studio 2005\source10\testole\testole\debug\vbe6ext.tlh
//
// C++ source equivalent of Win32 type library C:\Program Files\Common Files\Microsoft Shared\VBA\VBA6\VBE6EXT.OLB
// compiler-generated file created 10/10/08 at 14:03:16 - DO NOT EDIT!

#pragma once
#pragma pack(push, 8)

#include <comdef.h>

namespace VBIDE {

//
// Forward references and typedefs
//

struct __declspec(uuid("0002e157-0000-0000-c000-000000000046"))
/* LIBID */ __VBIDE;
struct __declspec(uuid("0002e158-0000-0000-c000-000000000046"))
/* dual interface */ Application;
enum vbextFileTypes;
struct __declspec(uuid("0002e166-0000-0000-c000-000000000046"))
/* dual interface */ testVBE;
enum vbext_WindowType;
enum vbext_WindowState;
struct __declspec(uuid("0002e16b-0000-0000-c000-000000000046"))
/* dual interface */ Window;
struct __declspec(uuid("0002e16a-0000-0000-c000-000000000046"))
/* dual interface */ _Windows_old;
struct __declspec(uuid("f57b7ed0-d8ab-11d1-85df-00c04f98f42c"))
/* dual interface */ _Windows;
struct /* coclass */ Windows;
struct __declspec(uuid("0002e16c-0000-0000-c000-000000000046"))
/* dual interface */ _LinkedWindows;
struct /* coclass */ LinkedWindows;
struct __declspec(uuid("0002e167-0000-0000-c000-000000000046"))
/* dual interface */ Events;
struct __declspec(uuid("0002e113-0000-0000-c000-000000000046"))
/* interface */ _VBProjectsEvents;
struct __declspec(uuid("0002e103-0000-0000-c000-000000000046"))
/* dispinterface */ _dispVBProjectsEvents;
struct __declspec(uuid("0002e115-0000-0000-c000-000000000046"))
/* interface */ _VBComponentsEvents;
struct __declspec(uuid("0002e116-0000-0000-c000-000000000046"))
/* dispinterface */ _dispVBComponentsEvents;
struct __declspec(uuid("0002e11a-0000-0000-c000-000000000046"))
/* interface */ _ReferencesEvents;
struct __declspec(uuid("0002e118-0000-0000-c000-000000000046"))
/* dispinterface */ _dispReferencesEvents;
struct /* coclass */ ReferencesEvents;
struct __declspec(uuid("0002e130-0000-0000-c000-000000000046"))
/* interface */ _CommandBarControlEvents;
struct __declspec(uuid("0002e131-0000-0000-c000-000000000046"))
/* dispinterface */ _dispCommandBarControlEvents;
struct /* coclass */ CommandBarEvents;
struct __declspec(uuid("0002e159-0000-0000-c000-000000000046"))
/* dual interface */ _ProjectTemplate;
struct /* coclass */ ProjectTemplate;
enum vbext_ProjectType;
enum vbext_ProjectProtection;
enum vbext_VBAMode;
struct __declspec(uuid("0002e160-0000-0000-c000-000000000046"))
/* dual interface */ _VBProject_Old;
struct __declspec(uuid("eee00915-e393-11d1-bb03-00c04fb6c4a6"))
/* dual interface */ _VBProject;
struct /* coclass */ VBProject;
struct __declspec(uuid("0002e165-0000-0000-c000-000000000046"))
/* dual interface */ _VBProjects_Old;
struct __declspec(uuid("eee00919-e393-11d1-bb03-00c04fb6c4a6"))
/* dual interface */ _VBProjects;
struct /* coclass */ VBProjects;
struct __declspec(uuid("be39f3d4-1b13-11d0-887f-00a0c90f2744"))
/* dual interface */ SelectedComponents;
enum vbext_ComponentType;
struct __declspec(uuid("0002e161-0000-0000-c000-000000000046"))
/* dual interface */ _Components;
struct /* coclass */ Components;
struct __declspec(uuid("0002e162-0000-0000-c000-000000000046"))
/* dual interface */ _VBComponents_Old;
struct __declspec(uuid("eee0091c-e393-11d1-bb03-00c04fb6c4a6"))
/* dual interface */ _VBComponents;
struct /* coclass */ VBComponents;
struct __declspec(uuid("0002e163-0000-0000-c000-000000000046"))
/* dual interface */ _Component;
struct /* coclass */ Component;
struct __declspec(uuid("0002e164-0000-0000-c000-000000000046"))
/* dual interface */ _VBComponent_Old;
struct __declspec(uuid("eee00921-e393-11d1-bb03-00c04fb6c4a6"))
/* dual interface */ _VBComponent;
struct /* coclass */ VBComponent;
struct __declspec(uuid("0002e18c-0000-0000-c000-000000000046"))
/* dual interface */ Property;
struct __declspec(uuid("0002e188-0000-0000-c000-000000000046"))
/* dual interface */ _Properties;
struct /* coclass */ Properties;
struct __declspec(uuid("da936b62-ac8b-11d1-b6e5-00a0c90f2744"))
/* dual interface */ _AddIns;
struct /* coclass */ Addins;
struct __declspec(uuid("da936b64-ac8b-11d1-b6e5-00a0c90f2744"))
/* dual interface */ AddIn;
enum vbext_ProcKind;
struct __declspec(uuid("0002e16e-0000-0000-c000-000000000046"))
/* dual interface */ _CodeModule;
struct /* coclass */ CodeModule;
struct __declspec(uuid("0002e172-0000-0000-c000-000000000046"))
/* dual interface */ _CodePanes;
struct /* coclass */ CodePanes;
enum vbext_CodePaneview;
struct __declspec(uuid("0002e176-0000-0000-c000-000000000046"))
/* dual interface */ _CodePane;
struct /* coclass */ CodePane;
struct __declspec(uuid("0002e17a-0000-0000-c000-000000000046"))
/* dual interface */ _References;
enum vbext_RefKind;
struct __declspec(uuid("0002e17e-0000-0000-c000-000000000046"))
/* dual interface */ ignorethis;
struct __declspec(uuid("cdde3804-2064-11cf-867f-00aa005ff34a"))
/* dispinterface */ _dispReferences_Events;
struct /* coclass */ References;

//
// Smart pointer typedef declarations
//

_COM_SMARTPTR_TYPEDEF(Application, __uuidof(Application));
_COM_SMARTPTR_TYPEDEF(_VBProjectsEvents, __uuidof(_VBProjectsEvents));
_COM_SMARTPTR_TYPEDEF(_dispVBProjectsEvents, __uuidof(_dispVBProjectsEvents));
_COM_SMARTPTR_TYPEDEF(_VBComponentsEvents, __uuidof(_VBComponentsEvents));
_COM_SMARTPTR_TYPEDEF(_dispVBComponentsEvents, __uuidof(_dispVBComponentsEvents));
_COM_SMARTPTR_TYPEDEF(_ReferencesEvents, __uuidof(_ReferencesEvents));
_COM_SMARTPTR_TYPEDEF(_dispReferencesEvents, __uuidof(_dispReferencesEvents));
_COM_SMARTPTR_TYPEDEF(_CommandBarControlEvents, __uuidof(_CommandBarControlEvents));
_COM_SMARTPTR_TYPEDEF(_dispCommandBarControlEvents, __uuidof(_dispCommandBarControlEvents));
_COM_SMARTPTR_TYPEDEF(_ProjectTemplate, __uuidof(_ProjectTemplate));
_COM_SMARTPTR_TYPEDEF(Events, __uuidof(Events));
_COM_SMARTPTR_TYPEDEF(_Component, __uuidof(_Component));
_COM_SMARTPTR_TYPEDEF(SelectedComponents, __uuidof(SelectedComponents));
_COM_SMARTPTR_TYPEDEF(_dispReferences_Events, __uuidof(_dispReferences_Events));
_COM_SMARTPTR_TYPEDEF(testVBE, __uuidof(testVBE));
_COM_SMARTPTR_TYPEDEF(Window, __uuidof(Window));
_COM_SMARTPTR_TYPEDEF(_Windows_old, __uuidof(_Windows_old));
_COM_SMARTPTR_TYPEDEF(_LinkedWindows, __uuidof(_LinkedWindows));
_COM_SMARTPTR_TYPEDEF(_VBProject_Old, __uuidof(_VBProject_Old));
_COM_SMARTPTR_TYPEDEF(_VBProject, __uuidof(_VBProject));
_COM_SMARTPTR_TYPEDEF(_VBProjects_Old, __uuidof(_VBProjects_Old));
_COM_SMARTPTR_TYPEDEF(_VBProjects, __uuidof(_VBProjects));
_COM_SMARTPTR_TYPEDEF(_Components, __uuidof(_Components));
_COM_SMARTPTR_TYPEDEF(_VBComponents_Old, __uuidof(_VBComponents_Old));
_COM_SMARTPTR_TYPEDEF(_VBComponents, __uuidof(_VBComponents));
_COM_SMARTPTR_TYPEDEF(_VBComponent_Old, __uuidof(_VBComponent_Old));
_COM_SMARTPTR_TYPEDEF(_VBComponent, __uuidof(_VBComponent));
_COM_SMARTPTR_TYPEDEF(Property, __uuidof(Property));
_COM_SMARTPTR_TYPEDEF(_Properties, __uuidof(_Properties));
_COM_SMARTPTR_TYPEDEF(AddIn, __uuidof(AddIn));
_COM_SMARTPTR_TYPEDEF(_Windows, __uuidof(_Windows));
_COM_SMARTPTR_TYPEDEF(_AddIns, __uuidof(_AddIns));
_COM_SMARTPTR_TYPEDEF(_CodeModule, __uuidof(_CodeModule));
_COM_SMARTPTR_TYPEDEF(_CodePanes, __uuidof(_CodePanes));
_COM_SMARTPTR_TYPEDEF(_CodePane, __uuidof(_CodePane));
_COM_SMARTPTR_TYPEDEF(ignorethis, __uuidof(ignorethis));
_COM_SMARTPTR_TYPEDEF(_References, __uuidof(_References));

//
// Type library items
//

struct __declspec(uuid("0002e158-0000-0000-c000-000000000046"))
Application : IDispatch
{
    //
    // Raw methods provided by interface
    //

      virtual HRESULT __stdcall get_Version (
        /*[out,retval]*/ BSTR * lpbstrReturn ) = 0;
};

enum __declspec(uuid("06a03650-2369-11ce-bfdc-08002b2b8cda"))
vbextFileTypes
{
    vbextFileTypeForm = 0,
    vbextFileTypeModule = 1,
    vbextFileTypeClass = 2,
    vbextFileTypeProject = 3,
    vbextFileTypeExe = 4,
    vbextFileTypeFrx = 5,
    vbextFileTypeRes = 6,
    vbextFileTypeUserControl = 7,
    vbextFileTypePropertyPage = 8,
    vbextFileTypeDocObject = 9,
    vbextFileTypeBinary = 10,
    vbextFileTypeGroupProject = 11,
    vbextFileTypeDesigners = 12
};

enum __declspec(uuid("be39f3db-1b13-11d0-887f-00a0c90f2744"))
vbext_WindowType
{
    vbext_wt_CodeWindow = 0,
    vbext_wt_Designer = 1,
    vbext_wt_Browser = 2,
    vbext_wt_Watch = 3,
    vbext_wt_Locals = 4,
    vbext_wt_Immediate = 5,
    vbext_wt_ProjectWindow = 6,
    vbext_wt_PropertyWindow = 7,
    vbext_wt_Find = 8,
    vbext_wt_FindReplace = 9,
    vbext_wt_Toolbox = 10,
    vbext_wt_LinkedWindowFrame = 11,
    vbext_wt_MainWindow = 12,
    vbext_wt_ToolWindow = 15
};

enum __declspec(uuid("be39f3dc-1b13-11d0-887f-00a0c90f2744"))
vbext_WindowState
{
    vbext_ws_Normal = 0,
    vbext_ws_Minimize = 1,
    vbext_ws_Maximize = 2
};

struct __declspec(uuid("0002e185-0000-0000-c000-000000000046"))
Windows;
    // [ default ] interface _Windows

struct __declspec(uuid("0002e187-0000-0000-c000-000000000046"))
LinkedWindows;
    // [ default ] interface _LinkedWindows

struct __declspec(uuid("0002e113-0000-0000-c000-000000000046"))
_VBProjectsEvents : IUnknown
{};

struct __declspec(uuid("0002e103-0000-0000-c000-000000000046"))
_dispVBProjectsEvents : IDispatch
{};

struct __declspec(uuid("0002e115-0000-0000-c000-000000000046"))
_VBComponentsEvents : IUnknown
{};

struct __declspec(uuid("0002e116-0000-0000-c000-000000000046"))
_dispVBComponentsEvents : IDispatch
{};

struct __declspec(uuid("0002e11a-0000-0000-c000-000000000046"))
_ReferencesEvents : IUnknown
{};

struct __declspec(uuid("0002e118-0000-0000-c000-000000000046"))
_dispReferencesEvents : IDispatch
{};

struct __declspec(uuid("0002e119-0000-0000-c000-000000000046"))
ReferencesEvents;
    // [ default ] interface _ReferencesEvents
    // [ default, source ] dispinterface _dispReferencesEvents

struct __declspec(uuid("0002e130-0000-0000-c000-000000000046"))
_CommandBarControlEvents : IUnknown
{};

struct __declspec(uuid("0002e131-0000-0000-c000-000000000046"))
_dispCommandBarControlEvents : IDispatch
{};

struct __declspec(uuid("0002e132-0000-0000-c000-000000000046"))
CommandBarEvents;
    // [ default ] interface _CommandBarControlEvents
    // [ default, source ] dispinterface _dispCommandBarControlEvents

struct __declspec(uuid("0002e159-0000-0000-c000-000000000046"))
_ProjectTemplate : IDispatch
{
    //
    // Raw methods provided by interface
    //

      virtual HRESULT __stdcall get_Application (
        /*[out,retval]*/ struct Application * * lppaReturn ) = 0;
      virtual HRESULT __stdcall get_Parent (
        /*[out,retval]*/ struct Application * * lppaReturn ) = 0;
};

struct __declspec(uuid("32cdf9e0-1602-11ce-bfdc-08002b2b8cda"))
ProjectTemplate;
    // [ default ] interface _ProjectTemplate

enum __declspec(uuid("ffcf3247-debf-11d1-baff-00c04fb6c4a6"))
vbext_ProjectType
{
    vbext_pt_HostProject = 100,
    vbext_pt_StandAlone = 101
};

enum __declspec(uuid("0002e129-0000-0000-c000-000000000046"))
vbext_ProjectProtection
{
    vbext_pp_none = 0,
    vbext_pp_locked = 1
};

enum __declspec(uuid("be39f3d2-1b13-11d0-887f-00a0c90f2744"))
vbext_VBAMode
{
    vbext_vm_Run = 0,
    vbext_vm_Break = 1,
    vbext_vm_Design = 2
};

struct __declspec(uuid("0002e169-0000-0000-c000-000000000046"))
VBProject;
    // [ default ] interface _VBProject

struct __declspec(uuid("0002e167-0000-0000-c000-000000000046"))
Events : IDispatch
{
    //
    // Raw methods provided by interface
    //

      virtual HRESULT __stdcall get_ReferencesEvents (
        /*[in]*/ struct _VBProject * VBProject,
        /*[out,retval]*/ struct _ReferencesEvents * * prceNew ) = 0;
      virtual HRESULT __stdcall get_CommandBarEvents (
        /*[in]*/ IDispatch * CommandBarControl,
        /*[out,retval]*/ struct _CommandBarControlEvents * * prceNew ) = 0;
};

struct __declspec(uuid("0002e101-0000-0000-c000-000000000046"))
VBProjects;
    // [ default ] interface _VBProjects

enum __declspec(uuid("be39f3d5-1b13-11d0-887f-00a0c90f2744"))
vbext_ComponentType
{
    vbext_ct_StdModule = 1,
    vbext_ct_ClassModule = 2,
    vbext_ct_MSForm = 3,
    vbext_ct_ActiveXDesigner = 11,
    vbext_ct_Document = 100
};

struct __declspec(uuid("be39f3d6-1b13-11d0-887f-00a0c90f2744"))
Components;
    // [ default ] interface _Components

struct __declspec(uuid("be39f3d7-1b13-11d0-887f-00a0c90f2744"))
VBComponents;
    // [ default ] interface _VBComponents

struct __declspec(uuid("0002e163-0000-0000-c000-000000000046"))
_Component : IDispatch
{
    //
    // Raw methods provided by interface
    //

      virtual HRESULT __stdcall get_Application (
        /*[out,retval]*/ struct Application * * lppaReturn ) = 0;
      virtual HRESULT __stdcall get_Parent (
        /*[out,retval]*/ struct _Components * * lppcReturn ) = 0;
      virtual HRESULT __stdcall get_IsDirty (
        /*[out,retval]*/ VARIANT_BOOL * lpfReturn ) = 0;
      virtual HRESULT __stdcall put_IsDirty (
        /*[in]*/ VARIANT_BOOL lpfReturn ) = 0;
      virtual HRESULT __stdcall get_Name (
        /*[out,retval]*/ BSTR * pbstrReturn ) = 0;
      virtual HRESULT __stdcall put_Name (
        /*[in]*/ BSTR pbstrReturn ) = 0;
};

struct __declspec(uuid("be39f3d8-1b13-11d0-887f-00a0c90f2744"))
Component;
    // [ default ] interface _Component

struct __declspec(uuid("be39f3d4-1b13-11d0-887f-00a0c90f2744"))
SelectedComponents : IDispatch
{
    //
    // Raw methods provided by interface
    //

      virtual HRESULT __stdcall Item (
        /*[in]*/ int index,
        /*[out,retval]*/ struct _Component * * lppcReturn ) = 0;
      virtual HRESULT __stdcall get_Application (
        /*[out,retval]*/ struct Application * * lppaReturn ) = 0;
      virtual HRESULT __stdcall get_Parent (
        /*[out,retval]*/ struct _VBProject * * lppptReturn ) = 0;
      virtual HRESULT __stdcall get_Count (
        /*[out,retval]*/ long * lplReturn ) = 0;
      virtual HRESULT __stdcall _NewEnum (
        /*[out,retval]*/ IUnknown * * lppiuReturn ) = 0;
};

struct __declspec(uuid("be39f3da-1b13-11d0-887f-00a0c90f2744"))
VBComponent;
    // [ default ] interface _VBComponent

struct __declspec(uuid("0002e18b-0000-0000-c000-000000000046"))
Properties;
    // [ default ] interface _Properties

struct __declspec(uuid("da936b63-ac8b-11d1-b6e5-00a0c90f2744"))
Addins;
    // [ default ] interface _AddIns

enum vbext_ProcKind
{
    vbext_pk_Proc = 0,
    vbext_pk_Let = 1,
    vbext_pk_Set = 2,
    vbext_pk_Get = 3
};

struct __declspec(uuid("0002e170-0000-0000-c000-000000000046"))
CodeModule;
    // [ default ] interface _CodeModule

struct __declspec(uuid("0002e174-0000-0000-c000-000000000046"))
CodePanes;
    // [ default ] interface _CodePanes

enum vbext_CodePaneview
{
    vbext_cv_ProcedureView = 0,
    vbext_cv_FullModuleView = 1
};

struct __declspec(uuid("0002e178-0000-0000-c000-000000000046"))
CodePane;
    // [ default ] interface _CodePane

enum vbext_RefKind
{
    vbext_rk_TypeLib = 0,
    vbext_rk_Project = 1
};

struct __declspec(uuid("cdde3804-2064-11cf-867f-00aa005ff34a"))
_dispReferences_Events : IDispatch
{};

struct __declspec(uuid("0002e17c-0000-0000-c000-000000000046"))
References;
    // [ default ] interface _References
    // [ default, source ] dispinterface _dispReferences_Events

struct __declspec(uuid("0002e166-0000-0000-c000-000000000046"))
testVBE : Application
{
    //
    // Raw methods provided by interface
    //

      virtual HRESULT __stdcall get_VBProjects (
        /*[out,retval]*/ struct _VBProjects * * lppptReturn ) = 0;
      virtual HRESULT __stdcall get_CommandBars (
        /*[out,retval]*/ __missing_type__ * * ppcbs ) = 0;

At Nick's request, I'm posting the build error output and following that the vbe6ext.tlh file, up to the error:

********************* Build output:

1>------ Build started: Project: testole, Configuration: Debug Win32 ------
1>Compiling...
1>testoleDlg.cpp
1>c:\users\sniles\documents\visual studio 2005\source10\testole\testole\debug\vbe6ext.tlh(463) : error C2061: syntax error : identifier '__missing_type__'
1>c:\users\sniles\documents\visual studio 2005\source10\testole\testole\testoledlg.cpp(164) : error C2065: '_Application' : undeclared identifier
1>c:\users\sniles\documents\visual studio 2005\source10\testole\testole\testoledlg.cpp(164) : error C2146: syntax error : missing ';' before identifier 'app'
1>c:\users\sniles\documents\visual studio 2005\source10\testole\testole\testoledlg.cpp(164) : error C2065: 'app' : undeclared identifier
1>c:\users\sniles\documents\visual studio 2005\source10\testole\testole\testoledlg.cpp(166) : error C2228: left of '.CreateDispatch' must have class/struct/union
1>        type is ''unknown-type''
1>c:\users\sniles\documents\visual studio 2005\source10\testole\testole\testoledlg.cpp(172) : error C2228: left of '.SetVisible' must have class/struct/union
1>        type is ''unknown-type''
1>Build log was saved at "file://c:\Users\sniles\Documents\Visual Studio 2005\Source10\testole\testole\Debug\BuildLog.htm"
1>testole - 6 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

*******************  vbe6ext.tlh
// Created by Microsoft (R) C/C++ Compiler Version 14.00.50727.42 (e112bc16).
//
// c:\users\sniles\documents\visual studio 2005\source10\testole\testole\debug\vbe6ext.tlh
//
// C++ source equivalent of Win32 type library C:\Program Files\Common Files\Microsoft Shared\VBA\VBA6\VBE6EXT.OLB
// compiler-generated file created 10/10/08 at 14:03:16 - DO NOT EDIT!

#pragma once
#pragma pack(push, 8)

#include <comdef.h>

namespace VBIDE {

//
// Forward references and typedefs
//

struct __declspec(uuid("0002e157-0000-0000-c000-000000000046"))
/* LIBID */ __VBIDE;
struct __declspec(uuid("0002e158-0000-0000-c000-000000000046"))
/* dual interface */ Application;
enum vbextFileTypes;
struct __declspec(uuid("0002e166-0000-0000-c000-000000000046"))
/* dual interface */ testVBE;
enum vbext_WindowType;
enum vbext_WindowState;
struct __declspec(uuid("0002e16b-0000-0000-c000-000000000046"))
/* dual interface */ Window;
struct __declspec(uuid("0002e16a-0000-0000-c000-000000000046"))
/* dual interface */ _Windows_old;
struct __declspec(uuid("f57b7ed0-d8ab-11d1-85df-00c04f98f42c"))
/* dual interface */ _Windows;
struct /* coclass */ Windows;
struct __declspec(uuid("0002e16c-0000-0000-c000-000000000046"))
/* dual interface */ _LinkedWindows;
struct /* coclass */ LinkedWindows;
struct __declspec(uuid("0002e167-0000-0000-c000-000000000046"))
/* dual interface */ Events;
struct __declspec(uuid("0002e113-0000-0000-c000-000000000046"))
/* interface */ _VBProjectsEvents;
struct __declspec(uuid("0002e103-0000-0000-c000-000000000046"))
/* dispinterface */ _dispVBProjectsEvents;
struct __declspec(uuid("0002e115-0000-0000-c000-000000000046"))
/* interface */ _VBComponentsEvents;
struct __declspec(uuid("0002e116-0000-0000-c000-000000000046"))
/* dispinterface */ _dispVBComponentsEvents;
struct __declspec(uuid("0002e11a-0000-0000-c000-000000000046"))
/* interface */ _ReferencesEvents;
struct __declspec(uuid("0002e118-0000-0000-c000-000000000046"))
/* dispinterface */ _dispReferencesEvents;
struct /* coclass */ ReferencesEvents;
struct __declspec(uuid("0002e130-0000-0000-c000-000000000046"))
/* interface */ _CommandBarControlEvents;
struct __declspec(uuid("0002e131-0000-0000-c000-000000000046"))
/* dispinterface */ _dispCommandBarControlEvents;
struct /* coclass */ CommandBarEvents;
struct __declspec(uuid("0002e159-0000-0000-c000-000000000046"))
/* dual interface */ _ProjectTemplate;
struct /* coclass */ ProjectTemplate;
enum vbext_ProjectType;
enum vbext_ProjectProtection;
enum vbext_VBAMode;
struct __declspec(uuid("0002e160-0000-0000-c000-000000000046"))
/* dual interface */ _VBProject_Old;
struct __declspec(uuid("eee00915-e393-11d1-bb03-00c04fb6c4a6"))
/* dual interface */ _VBProject;
struct /* coclass */ VBProject;
struct __declspec(uuid("0002e165-0000-0000-c000-000000000046"))
/* dual interface */ _VBProjects_Old;
struct __declspec(uuid("eee00919-e393-11d1-bb03-00c04fb6c4a6"))
/* dual interface */ _VBProjects;
struct /* coclass */ VBProjects;
struct __declspec(uuid("be39f3d4-1b13-11d0-887f-00a0c90f2744"))
/* dual interface */ SelectedComponents;
enum vbext_ComponentType;
struct __declspec(uuid("0002e161-0000-0000-c000-000000000046"))
/* dual interface */ _Components;
struct /* coclass */ Components;
struct __declspec(uuid("0002e162-0000-0000-c000-000000000046"))
/* dual interface */ _VBComponents_Old;
struct __declspec(uuid("eee0091c-e393-11d1-bb03-00c04fb6c4a6"))
/* dual interface */ _VBComponents;
struct /* coclass */ VBComponents;
struct __declspec(uuid("0002e163-0000-0000-c000-000000000046"))
/* dual interface */ _Component;
struct /* coclass */ Component;
struct __declspec(uuid("0002e164-0000-0000-c000-000000000046"))
/* dual interface */ _VBComponent_Old;
struct __declspec(uuid("eee00921-e393-11d1-bb03-00c04fb6c4a6"))
/* dual interface */ _VBComponent;
struct /* coclass */ VBComponent;
struct __declspec(uuid("0002e18c-0000-0000-c000-000000000046"))
/* dual interface */ Property;
struct __declspec(uuid("0002e188-0000-0000-c000-000000000046"))
/* dual interface */ _Properties;
struct /* coclass */ Properties;
struct __declspec(uuid("da936b62-ac8b-11d1-b6e5-00a0c90f2744"))
/* dual interface */ _AddIns;
struct /* coclass */ Addins;
struct __declspec(uuid("da936b64-ac8b-11d1-b6e5-00a0c90f2744"))
/* dual interface */ AddIn;
enum vbext_ProcKind;
struct __declspec(uuid("0002e16e-0000-0000-c000-000000000046"))
/* dual interface */ _CodeModule;
struct /* coclass */ CodeModule;
struct __declspec(uuid("0002e172-0000-0000-c000-000000000046"))
/* dual interface */ _CodePanes;
struct /* coclass */ CodePanes;
enum vbext_CodePaneview;
struct __declspec(uuid("0002e176-0000-0000-c000-000000000046"))
/* dual interface */ _CodePane;
struct /* coclass */ CodePane;
struct __declspec(uuid("0002e17a-0000-0000-c000-000000000046"))
/* dual interface */ _References;
enum vbext_RefKind;
struct __declspec(uuid("0002e17e-0000-0000-c000-000000000046"))
/* dual interface */ ignorethis;
struct __declspec(uuid("cdde3804-2064-11cf-867f-00aa005ff34a"))
/* dispinterface */ _dispReferences_Events;
struct /* coclass */ References;

//
// Smart pointer typedef declarations
//

_COM_SMARTPTR_TYPEDEF(Application, __uuidof(Application));
_COM_SMARTPTR_TYPEDEF(_VBProjectsEvents, __uuidof(_VBProjectsEvents));
_COM_SMARTPTR_TYPEDEF(_dispVBProjectsEvents, __uuidof(_dispVBProjectsEvents));
_COM_SMARTPTR_TYPEDEF(_VBComponentsEvents, __uuidof(_VBComponentsEvents));
_COM_SMARTPTR_TYPEDEF(_dispVBComponentsEvents, __uuidof(_dispVBComponentsEvents));
_COM_SMARTPTR_TYPEDEF(_ReferencesEvents, __uuidof(_ReferencesEvents));
_COM_SMARTPTR_TYPEDEF(_dispReferencesEvents, __uuidof(_dispReferencesEvents));
_COM_SMARTPTR_TYPEDEF(_CommandBarControlEvents, __uuidof(_CommandBarControlEvents));
_COM_SMARTPTR_TYPEDEF(_dispCommandBarControlEvents, __uuidof(_dispCommandBarControlEvents));
_COM_SMARTPTR_TYPEDEF(_ProjectTemplate, __uuidof(_ProjectTemplate));
_COM_SMARTPTR_TYPEDEF(Events, __uuidof(Events));
_COM_SMARTPTR_TYPEDEF(_Component, __uuidof(_Component));
_COM_SMARTPTR_TYPEDEF(SelectedComponents, __uuidof(SelectedComponents));
_COM_SMARTPTR_TYPEDEF(_dispReferences_Events, __uuidof(_dispReferences_Events));
_COM_SMARTPTR_TYPEDEF(testVBE, __uuidof(testVBE));
_COM_SMARTPTR_TYPEDEF(Window, __uuidof(Window));
_COM_SMARTPTR_TYPEDEF(_Windows_old, __uuidof(_Windows_old));
_COM_SMARTPTR_TYPEDEF(_LinkedWindows, __uuidof(_LinkedWindows));
_COM_SMARTPTR_TYPEDEF(_VBProject_Old, __uuidof(_VBProject_Old));
_COM_SMARTPTR_TYPEDEF(_VBProject, __uuidof(_VBProject));
_COM_SMARTPTR_TYPEDEF(_VBProjects_Old, __uuidof(_VBProjects_Old));
_COM_SMARTPTR_TYPEDEF(_VBProjects, __uuidof(_VBProjects));
_COM_SMARTPTR_TYPEDEF(_Components, __uuidof(_Components));
_COM_SMARTPTR_TYPEDEF(_VBComponents_Old, __uuidof(_VBComponents_Old));
_COM_SMARTPTR_TYPEDEF(_VBComponents, __uuidof(_VBComponents));
_COM_SMARTPTR_TYPEDEF(_VBComponent_Old, __uuidof(_VBComponent_Old));
_COM_SMARTPTR_TYPEDEF(_VBComponent, __uuidof(_VBComponent));
_COM_SMARTPTR_TYPEDEF(Property, __uuidof(Property));
_COM_SMARTPTR_TYPEDEF(_Properties, __uuidof(_Properties));
_COM_SMARTPTR_TYPEDEF(AddIn, __uuidof(AddIn));
_COM_SMARTPTR_TYPEDEF(_Windows, __uuidof(_Windows));
_COM_SMARTPTR_TYPEDEF(_AddIns, __uuidof(_AddIns));
_COM_SMARTPTR_TYPEDEF(_CodeModule, __uuidof(_CodeModule));
_COM_SMARTPTR_TYPEDEF(_CodePanes, __uuidof(_CodePanes));
_COM_SMARTPTR_TYPEDEF(_CodePane, __uuidof(_CodePane));
_COM_SMARTPTR_TYPEDEF(ignorethis, __uuidof(ignorethis));
_COM_SMARTPTR_TYPEDEF(_References, __uuidof(_References));

//
// Type library items
//

struct __declspec(uuid("0002e158-0000-0000-c000-000000000046"))
Application : IDispatch
{
    //
    // Raw methods provided by interface
    //

      virtual HRESULT __stdcall get_Version (
        /*[out,retval]*/ BSTR * lpbstrReturn ) = 0;
};

enum __declspec(uuid("06a03650-2369-11ce-bfdc-08002b2b8cda"))
vbextFileTypes
{
    vbextFileTypeForm = 0,
    vbextFileTypeModule = 1,
    vbextFileTypeClass = 2,
    vbextFileTypeProject = 3,
    vbextFileTypeExe = 4,
    vbextFileTypeFrx = 5,
    vbextFileTypeRes = 6,
    vbextFileTypeUserControl = 7,
    vbextFileTypePropertyPage = 8,
    vbextFileTypeDocObject = 9,
    vbextFileTypeBinary = 10,
    vbextFileTypeGroupProject = 11,
    vbextFileTypeDesigners = 12
};

enum __declspec(uuid("be39f3db-1b13-11d0-887f-00a0c90f2744"))
vbext_WindowType
{
    vbext_wt_CodeWindow = 0,
    vbext_wt_Designer = 1,
    vbext_wt_Browser = 2,
    vbext_wt_Watch = 3,
    vbext_wt_Locals = 4,
    vbext_wt_Immediate = 5,
    vbext_wt_ProjectWindow = 6,
    vbext_wt_PropertyWindow = 7,
    vbext_wt_Find = 8,
    vbext_wt_FindReplace = 9,
    vbext_wt_Toolbox = 10,
    vbext_wt_LinkedWindowFrame = 11,
    vbext_wt_MainWindow = 12,
    vbext_wt_ToolWindow = 15
};

enum __declspec(uuid("be39f3dc-1b13-11d0-887f-00a0c90f2744"))
vbext_WindowState
{
    vbext_ws_Normal = 0,
    vbext_ws_Minimize = 1,
    vbext_ws_Maximize = 2
};

struct __declspec(uuid("0002e185-0000-0000-c000-000000000046"))
Windows;
    // [ default ] interface _Windows

struct __declspec(uuid("0002e187-0000-0000-c000-000000000046"))
LinkedWindows;
    // [ default ] interface _LinkedWindows

struct __declspec(uuid("0002e113-0000-0000-c000-000000000046"))
_VBProjectsEvents : IUnknown
{};

struct __declspec(uuid("0002e103-0000-0000-c000-000000000046"))
_dispVBProjectsEvents : IDispatch
{};

struct __declspec(uuid("0002e115-0000-0000-c000-000000000046"))
_VBComponentsEvents : IUnknown
{};

struct __declspec(uuid("0002e116-0000-0000-c000-000000000046"))
_dispVBComponentsEvents : IDispatch
{};

struct __declspec(uuid("0002e11a-0000-0000-c000-000000000046"))
_ReferencesEvents : IUnknown
{};

struct __declspec(uuid("0002e118-0000-0000-c000-000000000046"))
_dispReferencesEvents : IDispatch
{};

struct __declspec(uuid("0002e119-0000-0000-c000-000000000046"))
ReferencesEvents;
    // [ default ] interface _ReferencesEvents
    // [ default, source ] dispinterface _dispReferencesEvents

struct __declspec(uuid("0002e130-0000-0000-c000-000000000046"))
_CommandBarControlEvents : IUnknown
{};

struct __declspec(uuid("0002e131-0000-0000-c000-000000000046"))
_dispCommandBarControlEvents : IDispatch
{};

struct __declspec(uuid("0002e132-0000-0000-c000-000000000046"))
CommandBarEvents;
    // [ default ] interface _CommandBarControlEvents
    // [ default, source ] dispinterface _dispCommandBarControlEvents

struct __declspec(uuid("0002e159-0000-0000-c000-000000000046"))
_ProjectTemplate : IDispatch
{
    //
    // Raw methods provided by interface
    //

      virtual HRESULT __stdcall get_Application (
        /*[out,retval]*/ struct Application * * lppaReturn ) = 0;
      virtual HRESULT __stdcall get_Parent (
        /*[out,retval]*/ struct Application * * lppaReturn ) = 0;
};

struct __declspec(uuid("32cdf9e0-1602-11ce-bfdc-08002b2b8cda"))
ProjectTemplate;
    // [ default ] interface _ProjectTemplate

enum __declspec(uuid("ffcf3247-debf-11d1-baff-00c04fb6c4a6"))
vbext_ProjectType
{
    vbext_pt_HostProject = 100,
    vbext_pt_StandAlone = 101
};

enum __declspec(uuid("0002e129-0000-0000-c000-000000000046"))
vbext_ProjectProtection
{
    vbext_pp_none = 0,
    vbext_pp_locked = 1
};

enum __declspec(uuid("be39f3d2-1b13-11d0-887f-00a0c90f2744"))
vbext_VBAMode
{
    vbext_vm_Run = 0,
    vbext_vm_Break = 1,
    vbext_vm_Design = 2
};

struct __declspec(uuid("0002e169-0000-0000-c000-000000000046"))
VBProject;
    // [ default ] interface _VBProject

struct __declspec(uuid("0002e167-0000-0000-c000-000000000046"))
Events : IDispatch
{
    //
    // Raw methods provided by interface
    //

      virtual HRESULT __stdcall get_ReferencesEvents (
        /*[in]*/ struct _VBProject * VBProject,
        /*[out,retval]*/ struct _ReferencesEvents * * prceNew ) = 0;
      virtual HRESULT __stdcall get_CommandBarEvents (
        /*[in]*/ IDispatch * CommandBarControl,
        /*[out,retval]*/ struct _CommandBarControlEvents * * prceNew ) = 0;
};

struct __declspec(uuid("0002e101-0000-0000-c000-000000000046"))
VBProjects;
    // [ default ] interface _VBProjects

enum __declspec(uuid("be39f3d5-1b13-11d0-887f-00a0c90f2744"))
vbext_ComponentType
{
    vbext_ct_StdModule = 1,
    vbext_ct_ClassModule = 2,
    vbext_ct_MSForm = 3,
    vbext_ct_ActiveXDesigner = 11,
    vbext_ct_Document = 100
};

struct __declspec(uuid("be39f3d6-1b13-11d0-887f-00a0c90f2744"))
Components;
    // [ default ] interface _Components

struct __declspec(uuid("be39f3d7-1b13-11d0-887f-00a0c90f2744"))
VBComponents;
    // [ default ] interface _VBComponents

struct __declspec(uuid("0002e163-0000-0000-c000-000000000046"))
_Component : IDispatch
{
    //
    // Raw methods provided by interface
    //

      virtual HRESULT __stdcall get_Application (
        /*[out,retval]*/ struct Application * * lppaReturn ) = 0;
      virtual HRESULT __stdcall get_Parent (
        /*[out,retval]*/ struct _Components * * lppcReturn ) = 0;
      virtual HRESULT __stdcall get_IsDirty (
        /*[out,retval]*/ VARIANT_BOOL * lpfReturn ) = 0;
      virtual HRESULT __stdcall put_IsDirty (
        /*[in]*/ VARIANT_BOOL lpfReturn ) = 0;
      virtual HRESULT __stdcall get_Name (
        /*[out,retval]*/ BSTR * pbstrReturn ) = 0;
      virtual HRESULT __stdcall put_Name (
        /*[in]*/ BSTR pbstrReturn ) = 0;
};

struct __declspec(uuid("be39f3d8-1b13-11d0-887f-00a0c90f2744"))
Component;
    // [ default ] interface _Component

struct __declspec(uuid("be39f3d4-1b13-11d0-887f-00a0c90f2744"))
SelectedComponents : IDispatch
{
    //
    // Raw methods provided by interface
    //

      virtual HRESULT __stdcall Item (
        /*[in]*/ int index,
        /*[out,retval]*/ struct _Component * * lppcReturn ) = 0;
      virtual HRESULT __stdcall get_Application (
        /*[out,retval]*/ struct Application * * lppaReturn ) = 0;
      virtual HRESULT __stdcall get_Parent (
        /*[out,retval]*/ struct _VBProject * * lppptReturn ) = 0;
      virtual HRESULT __stdcall get_Count (
        /*[out,retval]*/ long * lplReturn ) = 0;
      virtual HRESULT __stdcall _NewEnum (
        /*[out,retval]*/ IUnknown * * lppiuReturn ) = 0;
};

struct __declspec(uuid("be39f3da-1b13-11d0-887f-00a0c90f2744"))
VBComponent;
    // [ default ] interface _VBComponent

struct __declspec(uuid("0002e18b-0000-0000-c000-000000000046"))
Properties;
    // [ default ] interface _Properties

struct __declspec(uuid("da936b63-ac8b-11d1-b6e5-00a0c90f2744"))
Addins;
    // [ default ] interface _AddIns

enum vbext_ProcKind
{
    vbext_pk_Proc = 0,
    vbext_pk_Let = 1,
    vbext_pk_Set = 2,
    vbext_pk_Get = 3
};

struct __declspec(uuid("0002e170-0000-0000-c000-000000000046"))
CodeModule;
    // [ default ] interface _CodeModule

struct __declspec(uuid("0002e174-0000-0000-c000-000000000046"))
CodePanes;
    // [ default ] interface _CodePanes

enum vbext_CodePaneview
{
    vbext_cv_ProcedureView = 0,
    vbext_cv_FullModuleView = 1
};

struct __declspec(uuid("0002e178-0000-0000-c000-000000000046"))
CodePane;
    // [ default ] interface _CodePane

enum vbext_RefKind
{
    vbext_rk_TypeLib = 0,
    vbext_rk_Project = 1
};

struct __declspec(uuid("cdde3804-2064-11cf-867f-00aa005ff34a"))
_dispReferences_Events : IDispatch
{};

struct __declspec(uuid("0002e17c-0000-0000-c000-000000000046"))
References;
    // [ default ] interface _References
    // [ default, source ] dispinterface _dispReferences_Events

struct __declspec(uuid("0002e166-0000-0000-c000-000000000046"))
testVBE : Application
{
    //
    // Raw methods provided by interface
    //

      virtual HRESULT __stdcall get_VBProjects (
        /*[out,retval]*/ struct _VBProjects * * lppptReturn ) = 0;
      virtual HRESULT __stdcall get_CommandBars (
        /*[out,retval]*/ __missing_type__ * * ppcbs ) = 0;
过气美图社 2024-07-13 05:33:02

我不熟悉 ClassWizard 包装器生成器,但看起来它可能#imported了没有命名空间的 Excel COM 类型库,并且您与 SDK 头文件发生了冲突。 检查 .tlh 文件并确保定义周围有命名空间。 如果没有,我会考虑使用 #import 以更手动(但更安全)的方式导入它。

直接使用#import查看; 它将在构建目录中生成 .tlh.tli 文件,然后您可以将目录与 CComPtr<> 等一起使用。 我发现这比使用 CW 包装类要简单得多。 无论如何,这就是我的建议。

I'm not familiar with the ClassWizard wrapper generator, but it looks like it may have #imported the Excel COM type library without a namespace, and you're getting conflicts with the SDK header files. Check the .tlh file and ensure there's a namespace around the definitions. If not, I'd look at importing it the more manual (but safer) way using #import.

Check out using #import directly; it will generate the .tlh and .tli files in the build directory, which you can then use directory with CComPtr<> and the like. I've found that to be much more straightforward than using CW wrapper classes. That's my advice anyway.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文