Solved

Type Libraries (tlb)

Posted on 2000-04-13
1
300 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Grammars for C C++ and java 1 114
Compile GLUT with Visual Studio 2015 1 108
Unresolved External Symbols 3 68
show out valin of json for debugging in visaul c++ 1 16
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…
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
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.

895 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now