Solved

How to reference a non-COM dll without using DllImport attribute

Posted on 2004-03-23
1
422 Views
Last Modified: 2010-08-05
Is there a way to reference a non-COM dll without using the [DllImport("dllname.dll")] syntax?  I was thinking you could add a reference to a dll and it would essentially create it's own namespace.  Instead, I get an error about the dll not being COM compliant.  The DllImport is fine for smaller dlls.  But if you want to add a dll that contains hundreds of functions, the code becomes pretty bulky and time consuming to create.
0
Comment
Question by:games0802
[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
1 Comment
 
LVL 22

Accepted Solution

by:
_TAD_ earned 50 total points
ID: 10671932


I don't think you can....

If this is a .Net (aka "managed") dll, then you can use Assembly.GetAssembly() and pInvoke methods.  If this is another type of dll (aka "un-managed" and compiled to native machine code), then you *have* to use DllImport.

At least... that has always been my understanding.
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

756 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