Solved

Type Libraries (tlb)

Posted on 2000-04-13
1
309 Views
Last Modified: 2011-08-18
I've only just started programming but really need to use a tlb for one of the projects i am working on.

The question is if i used the following declaration in Visual Basic

Dim iAcc as nfdataclient.IAccess

how would i perform the same declaration in C++.

I have imported (#import) the tlb into the program are there any other steps that are required to make it accessible?

Edgark@mintek.co.za
0
Comment
Question by:ratimics
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 9

Accepted Solution

by:
ShaunWilde earned 100 total points
ID: 2715291
I tend to use #import with the options no_namespace and named_guids

That way I don't need to mess with the namespaces (only really - I think - useful when you have the same interface in several different libraries)

to access your interface you can then use the smart pointers - in your case this interface could be

IAccessPtr ptrAccess;

and you then create it

ptrAccess.CreateInstance(CLSID_???);

the #import statement creeates 2 files in your output directory called .tli and .tlh and are always worth a look to see what has been created.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

695 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question