Discussion:
problems while #import "VBE6EXT.OLB"
(too old to reply)
emmai
2003-08-17 13:07:49 UTC
Permalink
the #import directive is like this:

#import "D:\Program Files\Common Files\Microsoft
Shared\VBA\VBA6\VBE6EXT.OLB"

while compiling,errors generated as below:

Compiling...
temp.cpp
E:\emmai\temp\temp.cpp(8) : error C2772: #import referenced a type from a
missing type library; '__missing_type__' used as a placeholder
e:\emmai\temp\debug\vbe6ext.tlh(212) : error C2146: syntax error : missing
';' before identifier 'CommandBars'
e:\emmai\temp\debug\vbe6ext.tlh(212) : error C2501: '__missing_type__' :
missing storage-class or type specifiers
e:\emmai\temp\debug\vbe6ext.tlh(212) : error C2501: 'CommandBars' : missing
storage-class or type specifiers
e:\emmai\temp\debug\vbe6ext.tlh(233) : error C2146: syntax error : missing
';' before identifier 'GetCommandBars'
e:\emmai\temp\debug\vbe6ext.tlh(233) : error C2501: '__missing_type__' :
missing storage-class or type specifiers
e:\emmai\temp\debug\vbe6ext.tlh(255) : error C2061: syntax error :
identifier '__missing_type__'
e:\emmai\temp\debug\vbe6ext.tli(32) : error C2143: syntax error : missing
';' before 'tag::id'
e:\emmai\temp\debug\vbe6ext.tli(32) : error C2433: '__missing_type__' :
'inline' not permitted on data declarations
e:\emmai\temp\debug\vbe6ext.tli(32) : error C2501: '__missing_type__' :
missing storage-class or type specifiers
e:\emmai\temp\debug\vbe6ext.tli(32) : fatal error C1004: unexpected end of
file found
Error executing cl.exe.

temp.exe - 11 error(s), 0 warning(s)
Kim Gräsman
2003-08-17 20:00:41 UTC
Permalink
emmai,

Please don't start up a new message thread when there's already one running
related to your question.

It seems this setup works OK:

#import "C:\Program Files\Common Files\Microsoft Shared\Office10\mso.dll"
rename_namespace("VBIDE") rename("RGB", "OfficeRGB")
#import "C:\Program Files\Common Files\Microsoft
Shared\VBA\VBA6\VBE6EXT.OLB" rename_namespace("VBIDE")

I noticed when I imported VBE6EXT.OLB that it said at the top of the
generated .tlh file:

//
// Cross-referenced type libraries:
//
// #import "C:\Program Files\Common Files\Microsoft
Shared\Office10\mso.dll"
//

So I copied the line, forced it into the same namespace and cleared up a
name collision. Weird that #import doesn't take care of this
automatically...

Does anyone know what "cross-referenced type library" corresponds to?
importlib?

Kim
emmai
2003-08-18 01:01:59 UTC
Permalink
I changed my #import directive like this:

#import "D:\Program Files\Common Files\Microsoft Shared\Office10\mso.dll"
rename_namespace("VBIDE") rename("RGB", "OfficeRGB")
#import "D:\Program Files\Common Files\Microsoft
Shared\VBA\VBA6\VBE6EXT.OLB" rename_namespace("VBIDE")

but the same problems is still there.....plz pay attention to the error
message where ---->:

Compiling...
temp.cpp
e:\emmai\temp\debug\mso.tlh(1036) : warning C4146: unary minus operator
applied to unsigned type, result still unsigned
---->e:\emmai\temp\temp.cpp(9) : error C2772: #import referenced a type from
a missing type library; '__missing_type__' used as a placeholder
e:\emmai\temp\debug\vbe6ext.tlh(212) : error C2146: syntax error : missing
';' before identifier 'CommandBars'
e:\emmai\temp\debug\vbe6ext.tlh(212) : error C2501: '__missing_type__' :
missing storage-class or type specifiers
e:\emmai\temp\debug\vbe6ext.tlh(212) : error C2208: 'struct
VBIDE::CommandBars' : no members defined using this type
e:\emmai\temp\debug\vbe6ext.tlh(233) : error C2146: syntax error : missing
';' before identifier 'GetCommandBars'
e:\emmai\temp\debug\vbe6ext.tlh(233) : error C2501: '__missing_type__' :
missing storage-class or type specifiers
e:\emmai\temp\debug\vbe6ext.tlh(255) : error C2061: syntax error :
identifier '__missing_type__'
e:\emmai\temp\debug\vbe6ext.tli(32) : error C2143: syntax error : missing
';' before 'tag::id'
e:\emmai\temp\debug\vbe6ext.tli(32) : error C2433: '__missing_type__' :
'inline' not permitted on data declarations
e:\emmai\temp\debug\vbe6ext.tli(32) : error C2501: '__missing_type__' :
missing storage-class or type specifiers
e:\emmai\temp\debug\vbe6ext.tli(32) : fatal error C1004: unexpected end of
file found
Error executing cl.exe.

temp.exe - 11 error(s), 1 warning(s)
Kim Gräsman
2003-08-18 11:14:46 UTC
Permalink
emmai,
Post by emmai
but the same problems is still there.....
That's curious... I've tested it in both VS.NET 2003 and VC6, without
problems.
Did you delete all .tlh and .tli files before rebuilding?
--
Best regards,
Kim Gräsman
Kim Gräsman
2003-08-18 13:42:56 UTC
Permalink
Craig,
As for your observation about what #import will and will not do
automatically, I've never found it to be all that smart.
Heh... This one is especially interesting, since they go to great lengths
for emitting a comment describing what's missing... They might as well have
removed the "//" in front of the #import line, and be done with it. Of
course, it'd be hard to handle namespace and symbol renaming then.

Thanks for the verification.
--
Best regards,
Kim Gräsman
Loading...