Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How to tell if a DLL is a COM DLL  or a FLAT DLL?

Posted on 2013-05-14
8
Medium Priority
?
538 Views
Last Modified: 2013-05-16
How can you tell if a particular DLL is a COM DLL or a NON COM DLL? Is there a tool to analyze each one? I know by using the ILDASM tool  you can tell the difference between a .NET DLL versus
 a non -.NET DLL?
0
Comment
Question by:metro156
[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
  • 4
  • 4
8 Comments
 
LVL 40
ID: 39168634
Unless you have a standalone dll file, in Visual Studio, since COM dlls need to be registered in the registry, COM dlls will show under the COM tab in the window used to add a reference. A .NET dll will either show in the .NET tab or not at all.

Also, once a reference has been added, if you click on the dll in the References window and look at the Properties window, you will get the type of dll in the File Type property. COM dlls show as ActiveX. This works at least since version 2010, I could not say for prior versions.

In code, you can try to load the dll with the Assembly.LoadFrom method. If it works, its a .NET dll, otherwise it is a COM or Win32 dll.
0
 

Author Comment

by:metro156
ID: 39168731
Ok, I understand what saying until you mention a standalone DLL. In Visual Studio under the reference tab called COM, how is the list populated to select from? Does Visual Studio check the registry for all COM types or is this a preset package of COM modules only associated with the Visual Studio tool?
Also, I am asking the same question specific to the reference tab called .NET; how is that list populated? Can you add to that list? or is that somehow preset package only associated with the Visual Studio tool?

I hope I am not a pain by asking those questions but I have always been curious how those[b TABS:   .NET and COM get their content
0
 
LVL 40

Accepted Solution

by:
Jacques Bourgeois (James Burger) earned 2000 total points
ID: 39168782
The COM list is indeed populated through a registry scan.

For the .NET list however, things are a bit different.

The framework dlls are automatically shown.

If you want to add a custom dll to that list, the easiest method is copy the dll in C:\Program Files\Microsoft Visual Studio 11.0\Common7\IDE\PublicAssemblies. The 11.0 in there if for Visual Studio 2012, change it to 10.0 for 2010, 9.0 for 2008 and so on.

Alternative methods are listed at http://msdn.microsoft.com/en-US/library/wkze6zky(v=VS.80).aspx
0
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

 

Author Closing Comment

by:metro156
ID: 39168796
Excellent answers. Thank you very much.
0
 

Author Comment

by:metro156
ID: 39169923
I just noticed under the Visual Studio - Add Reference - COM tab there is a heading called TypeLib version; That doesn't mean the dlls and exes mentioned under the Path heading are standalone Type Libraries necessarily but the actual COM dlls or exes that have type libraries embedded in them, correct? or they could be either standalone TLBs or COMs (with embedded Type Libraries)?
0
 
LVL 40
ID: 39170178
The assembly itself references the .dll / .exe / .ocx, so this is what you see after you have created the reference.

But what Visual Studio needs is the type library, the definition of the classes, properties, methods, etc. included in the application or library. In COM, the type library is most often included in the program itself, but depending on how the program was compiles it is also sometimes provided as a separate .tlb or .olb file. This is what you see when you are creating the reference.

The version of the type library is normally useless, but I suppose it could be useful to diagnose problems if, for some reason, the versions of the dll and of the type library are not the same.
0
 

Author Comment

by:metro156
ID: 39170313
Bottom line these COM tab modules are references not the actual COM module??
0
 
LVL 40
ID: 39170661
The name References tells it all.

What will happen with the COM files themselves depends on the rules you set in the Properties window.
0

Featured Post

Fill in the form and get your FREE NFR key NOW!

Veeam® is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

Question has a verified solution.

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

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
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…
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…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…

636 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