473,320 Members | 1,957 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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 2096
I use dumpbin.exe -exports "C:\Computer\Programs\MyUnmanaged.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("MyUnmanaged.dll", EntryPoint="#46")]
private static extern void MyExportedMethodOrdinal46(int k);

//example for unmangled names (C style)
[DllImport("MyUnmanaged.dll", EntryPoint="SetSpecialTreatment")]
private static extern void SetSpecialTreatment(int action);

"jayderk" <ja*****@hotmail.com> wrote in message
news:up**************@TK2MSFTNGP09.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
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...
3
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...
2
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...
2
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...
8
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...
2
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...
3
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
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...
0
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...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.