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

x
?
Solved

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

Posted on 2004-03-23
1
Medium Priority
?
445 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 200 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

604 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