Solved

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

Posted on 2013-05-14
8
445 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
  • 4
  • 4
8 Comments
 
LVL 40

Expert Comment

by:Jacques Bourgeois (James Burger)
Comment Utility
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
Comment Utility
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 500 total points
Comment Utility
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
 

Author Closing Comment

by:metro156
Comment Utility
Excellent answers. Thank you very much.
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 

Author Comment

by:metro156
Comment Utility
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

Expert Comment

by:Jacques Bourgeois (James Burger)
Comment Utility
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
Comment Utility
Bottom line these COM tab modules are references not the actual COM module??
0
 
LVL 40

Expert Comment

by:Jacques Bourgeois (James Burger)
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
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…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

744 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