[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Simple ATL question

Posted on 2000-03-01
9
Medium Priority
?
206 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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 400 total points
ID: 2586739
ok

have a nice day,

ZOPPO
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
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…

650 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