#import type library problems 
Author Message
 #import type library problems

 I'm using VC6 SP3.  I used the New Project wizard to create a Win32 console
application that supports MFC.  I then added "#import tlbinf32.dll" below
the various #includes and compiled.  Many errors ensued.  I then moved the
#import above all #includes (including above #include stdafx.h).
Compilation succeeded.

Question #1:  Why?

I then attempted to create one of the imported objects, adding the following
to the end of the program, just before the last return statement:

TLI::_TLIApplicationPtr p(__uuidof(TLI::_TLIApplication));

Compiling now results in six errors:

Test.cpp(39) : error C2653:  'TLI' : is not a class or namespace name

Test.cpp(39) : error C2065: '_TLIApplicationPtr' : undeclared identifier

Test.cpp(39) : error C2146: syntax error : missing ';' before identifier 'p'

Test.cpp(39) : error C2065: 'p' : undeclared identifier

Test.cpp(39) : error C2653 : 'TLI' : is not a class or namespace name

Test.cpp(39) : error C2065: '_TLIApplication' : undeclared identifier

TLI is definitely a namespace declared in tlbinf32.tlh.  _TLIApplicationPtr
and _TLIApplication are also declared in that file.  If I add "using
namespace TLI" immediately after the #import statement, the first error goes
away but the other five errors remain.

Question #2:  How do I eliminate these errors?

Thanks in advance,

Michael

nospam-at-humbugreality.com



Tue, 19 Nov 2002 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. #import/type library problem

2. HELP: #import problem w/ COM type library

3. HELP: #import problem w/ COM type library

4. C++ attributes, #import progid and type libraries

5. Interface with Interface pointer from imported type library as argument

6. Importing type libraries

7. importing sql-dmo type library

8. import an excel type library question

9. #import type library

10. How to dynamically import type library ?

11. MessengerAPI type library - IDispatch enum type problem

12. VB type libraray import problem in VC...

 

 
Powered by phpBB® Forum Software