?
Solved

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

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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

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…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

770 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