Compiling...
StdAfx.cpp
d:\wordaddin\releasemindependency\VBE6EXT.tlh(212) : error C2146: syntax error : missing ';' before identifier 'CommandBars'
d:\wordaddin\releasemindependency\VBE6EXT.tlh(212) : error C2501: '__missing_type__' : missing storage-class or type specifiers
d:\wordaddin\releasemindependency\VBE6EXT.tlh(212) : error C2501: 'CommandBars' : missing storage-class or type specifiers
d:\wordaddin\releasemindependency\VBE6EXT.tlh(233) : error C2146: syntax error : missing ';' before identifier 'GetCommandBars'
d:\wordaddin\releasemindependency\VBE6EXT.tlh(233) : error C2501: '__missing_type__' : missing storage-class or type specifiers
d:\wordaddin\releasemindependency\VBE6EXT.tlh(255) : error C2061: syntax error : identifier '__missing_type__'
d:\wordaddin\releasemindependency\VBE6EXT.tli(32) : error C2143: syntax error : missing ';' before 'tag::id'
d:\wordaddin\releasemindependency\VBE6EXT.tli(32) : error C2433: '__missing_type__' : 'inline' not permitted on data declarations
d:\wordaddin\releasemindependency\VBE6EXT.tli(32) : error C2501: '__missing_type__' : missing storage-class or type specifiers
d:\wordaddin\releasemindependency\VBE6EXT.tli(32) : fatal error C1004: unexpected end of file found
Error executing cl.exe.WordAddin.dll - 10 error(s), 0 warning(s)
StdAfx.cpp
d:\wordaddin\releasemindependency\VBE6EXT.tlh(212) : error C2146: syntax error : missing ';' before identifier 'CommandBars'
d:\wordaddin\releasemindependency\VBE6EXT.tlh(212) : error C2501: '__missing_type__' : missing storage-class or type specifiers
d:\wordaddin\releasemindependency\VBE6EXT.tlh(212) : error C2501: 'CommandBars' : missing storage-class or type specifiers
d:\wordaddin\releasemindependency\VBE6EXT.tlh(233) : error C2146: syntax error : missing ';' before identifier 'GetCommandBars'
d:\wordaddin\releasemindependency\VBE6EXT.tlh(233) : error C2501: '__missing_type__' : missing storage-class or type specifiers
d:\wordaddin\releasemindependency\VBE6EXT.tlh(255) : error C2061: syntax error : identifier '__missing_type__'
d:\wordaddin\releasemindependency\VBE6EXT.tli(32) : error C2143: syntax error : missing ';' before 'tag::id'
d:\wordaddin\releasemindependency\VBE6EXT.tli(32) : error C2433: '__missing_type__' : 'inline' not permitted on data declarations
d:\wordaddin\releasemindependency\VBE6EXT.tli(32) : error C2501: '__missing_type__' : missing storage-class or type specifiers
d:\wordaddin\releasemindependency\VBE6EXT.tli(32) : fatal error C1004: unexpected end of file found
Error executing cl.exe.WordAddin.dll - 10 error(s), 0 warning(s)
using namespace Office;#import "D:\Program Files\Common Files\Microsoft Shared\VBA\VBA6\\VBE6EXT.OLB" rename_namespace("VBE6")
using namespace VBE6;#import "D:\Program Files\Microsoft Office\Office10\MSWORD.OLB" named_guids,rename_namespace("MSWORD")
using namespace MSWORD;
期待高手ing.....
If a type library includes references to types defined in other type libraries, then the .TLH file will include comments of the following sort: //
// Cross-referenced type libraries:
//
// #import "c:\path\typelib0.tlb"
//
The actual filename in the #import comment is the full path of the cross-referenced type library, as stored in the registry. If you encounter errors that are due to missing type definitions, check the comments at the head of the .TLH to see which dependent type libraries may need to be imported first. Likely errors are syntax errors (for example, C2143, C2146, C2321), C2501 (missing decl-specifiers), or C2433 ('inline' not permitted on data declaration) while compiling the .TLI file. You must determine which of the dependency comments are not otherwise provided for by system headers and then provide an #import directive at some point before the #import directive of the dependent type library to resolve the errors.
using namespace Office;#import "C:\\Program Files\\Common Files\\Microsoft Shared\\VBA\\VBA6\\VBE6EXT.olb" rename_namespace("VBE6")
using namespace VBE6;#import "C:\\Program Files\\Microsoft Office\\Office10\\MSWORD.olb" rename("ExitWindows","ExitWindowsEx"),named_guids,rename_namespace("MSWord")
using namespace MSWord;试一下,我用没问题
现在的问题归结到VBE6EXT.OLB上了,而且全部是关于里面的CommandBars,
我查了MSDN关于Compiler Error C2772
上面说_missing_type_的发生是因为找不到或者没有正确注册secondary type library,
现在我不知道这个secondary type library是什么,或者说CommandBars是在哪个类型库里?
这是关于C2772 MSDN里的说明
Compiler Error C2772
#import referenced a type from a missing type library; '__missing_type__' used as a place holderWhile the compiler was processing the type library named by the #import directive, it encountered a referenced type defined in a secondary type library. In addition, this secondary type library could not be found, and the compiler could not send this typename to the type library headers. A dummy typename, "__missing_type__", was sent to the output instead. This will trigger additional errors as the type library headers are compiled.This error occurs when the secondary type library is not properly registered or missing. When the compiler detects this error, it cannot determine the name of the missing secondary type library. Search for the string "__missing_type__" in the type library headers. This may help determine the name of the secondary type library.
不过问题已经变向解决了