Solved

Simple ATL question

Posted on 2000-03-01
9
203 Views
Last Modified: 2013-11-25
What is the easiest way of reusing a COM component from ATL project?
I know only #import "component.tlb" method, but not always have corresponding type library. How can I generate it from DLL?

Apolo.
0
Comment
Question by:ekc
[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
  • 3
  • 3
  • 2
  • +1
9 Comments
 
LVL 31

Expert Comment

by:Zoppo
ID: 2572458
Hi ekc,

this is from MSDN:
--------------------------------------------------------------------------------------
The #import Directive

The #import directive is used to incorporate information from a type library. The content of the type library is converted into C++ classes, mostly describing the COM interfaces.

Syntax:
#import "filename" [attributes]
#import <filename> [attributes]

attributes:
attribute1, attribute2, ...
attribute1 attribute2 ...

filename is the name of the file containing the type library information. A file can be one of the following types:

-a type library (.TLB or .ODL) file
-an executable (.EXE) file
-a library (.DLL) file containing a type library resource (such as .OCX)
....
--------------------------------------------------------------------------------------

so, I think (even I've never tried) that you can even use #import with dll-files.

hope that helps,

ZOPPO
0
 
LVL 4

Expert Comment

by:mandhjo
ID: 2573019
You can #import COM DLL and EXE files.  I am currently doing this on my project.
0
 
LVL 23

Expert Comment

by:naveenkohli
ID: 2573424
something like this ..

#import "my.dll" raw_interfaces_only, raw_native_types, no_namespace, named_guids
0
Independent Software Vendors: 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!

 
LVL 4

Expert Comment

by:mandhjo
ID: 2573504
only without the commas (syntactically speaking)
0
 
LVL 5

Author Comment

by:ekc
ID: 2576406
Thank you all...
I thought that #import directive is the only solution (have never seen any simpler), and just wanted to be sure...
OLE/View can generate even .h i .c files (as well as .idl, which can be later used for building .tlb), but have never tried that...
0
 
LVL 4

Expert Comment

by:mandhjo
ID: 2576723
Glad we could all help.  In my opinion, Zoppo gets the points.
0
 
LVL 31

Expert Comment

by:Zoppo
ID: 2579276
I agree                     :o)
0
 
LVL 5

Author Comment

by:ekc
ID: 2584070
I also agree.
Zoppo, please, lock the question.
0
 
LVL 31

Accepted Solution

by:
Zoppo earned 100 total points
ID: 2586739
ok

have a nice day,

ZOPPO
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
In this post we will learn different types of Android Layout and some basics of an Android App.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

717 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