473,659 Members | 2,980 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Description of unmanaged exposed dll functions

I can not seem to find the thread that described how to expose the functions
of functions that are usable in an unmanaged dll? any help would be great

regards,
Jay
Nov 15 '05 #1
1 2121
I use dumpbin.exe -exports "C:\Computer\Pr ograms\MyUnmana ged.dll"

If it is a C++ DLL, you may have to access the functions by ordinal. If it
is C, you should be able to access them by name.
You'll have to use P/Invoke (Platform Invoke) to call the functions. Once
you declare the function as shown below,
you can call it as you would any other C# method. If the unmanaged functions
have tricky parameters, you'll have to
study up a bit on P/Invoke to figure out which .NET types to substitute for
the unmanaged parameter types.

//example for C++ name mangling -- use ordinal as shown with # prefix
[DllImport("MyUn managed.dll", EntryPoint="#46 ")]
private static extern void MyExportedMetho dOrdinal46(int k);

//example for unmangled names (C style)
[DllImport("MyUn managed.dll", EntryPoint="Set SpecialTreatmen t")]
private static extern void SetSpecialTreat ment(int action);

"jayderk" <ja*****@hotmai l.com> wrote in message
news:up******** ******@TK2MSFTN GP09.phx.gbl...
I can not seem to find the thread that described how to expose the functions of functions that are usable in an unmanaged dll? any help would be great

regards,
Jay

Nov 15 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
741
by: Bob Rock | last post by:
Hello, in the last few days I've made my first few attempts at creating mixed C++ managed-unmanaged assemblies and looking aftwerwards with ILDASM at what is visible in those assemblies from a managed point-of-view I've noticed that: 1) for each managed and unmanaged C function (not C++ classes) I get a public managed static method (defined on a 'Global Functions' class) in the generated assembly with an export name of the form...
3
1980
by: dydrmr | last post by:
Hi, I am developing a ASP.NET application which uses a 3rd party API that is an unmanaged C++ DLL. The possible solutions that I have in mind to build the .NET to C++ bridge: 1. Import the unmanaged C++ DLL in the .NET (C#) program and call the functions as static entry points exposed by the DLL. This would be very cumbersome as it wont let the .NET app have a Object Oriented design. 2. Build a COM wrapper using C++ around the...
2
5999
by: Paul Kenny | last post by:
Hi, I am trying to expose the functionality of an unmanaged C++ class to the other languages available in the .NET Framework. I have decided to do this by wrapping the unmanaged C++ class in a managed one. I have taken a look at following sample code on how to do this. http://longhorn.msdn.microsoft.com/lhsdk/ndp/vcmg_appendixs amplecode.aspx
2
9494
by: joye | last post by:
Hello, My question is how to use C# to call the existing libraries containing unmanaged C++ classes directly, but not use C# or managed C++ wrappers unmanaged C++ classes? Does anyone know how to do that? Thanks. Tsung-Yu
8
17245
by: Marty | last post by:
Hi, I want to wrap an unmanaged c++ lib file (mylib.lib) to use it in a VS.NET 2003 C# project. I use the DLLImport but it can't see the lib file. Is it because it is a lib file instead of a dll? public static extern string myFunction(string strTest);
2
2045
by: Bob Rock | last post by:
Hello, in the last few days I've made my first few attempts at creating mixed C++ managed-unmanaged assemblies and looking afterwards with ILDASM at what is visible in those assemblies from a managed point-of-view I've noticed that: 1) for each managed and unmanaged C function (not C++ classes) I get a public managed static method (defined on a 'Global Functions' class) in the generated assembly with an export name of the form
3
3500
by: zhphust | last post by:
I want to convert a object of a managed class to a unmanaged structure that has the same member with that managed class. Can anybody tell me how i can do it? Thanks in advance. -- zhphust ------------------------------------------------------------------------
3
1949
by: Tommy Svensson \(InfoGrafix\) | last post by:
I've been instructed to work againt a huge unmanaged C++ API from a C# application. Now, the only way, as I've understood it, is to go the Managed Extensions for C++ way. This means I have to write a wrapper between unmanaged API and my managed app. Now on to the question: If there's an unmanaged API class called X with a defined method
0
812
by: Rob C | last post by:
I have an unmanaged app written using VS2003 VC++. I was able to connect to a webservice by selecting "Add Web Reference" and selecting a WSDL file in the project menu. This created a header file that had functions exposed by the webserver that I was able to call. In that file, there was an explicit reference to the URL where the webservice lives. This is fine if i always want to use that particular webserver. However, I need to...
0
8335
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8851
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8528
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8627
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7356
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4335
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2752
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1976
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1737
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.