Solved

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

Posted on 2004-03-23
1
427 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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Set custom font WPF 2 24
How to escape alias names for Oracle query 1 38
Adjust the codes 3 60
How to input barcode scanner data into textbox in C#  ? 13 47
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…
This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.
Suggested Courses

736 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