question

npsiegfried-6946 avatar image
0 Votes"
npsiegfried-6946 asked Viorel-1 commented

Getting functions from an .exe or unmanaged .dll

A programmer wrote a VB wrapper around Lame.exe and it gives all of the information I need. I have intermediate knowledge in C# and I'd like to create a C# wrapper. The example at CodeProject.com is old (2004) but it still works. and it's written in VB. Can anyone give me information on what tools I'm going to need to do this? Lame.exe is not a COM component and lame_enc is an unmanaged dll. I don't where to begin with this project. Please help!

dotnet-csharp
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

The link only points to the root of code project. Please edit your post and provide the proper link to the code.

0 Votes 0 ·

If the wrapper is made in VB.NET as a Class Library, then it can be used (referenced) in C# projects with less effort.

0 Votes 0 ·

1 Answer

TimonYang-MSFT avatar image
0 Votes"
TimonYang-MSFT answered

For unmanaged dll, we can use Platform Invoke (P/Invoke) to use it.

Please check the following documents:

Platform Invoke (P/Invoke)

Interoperating with unmanaged code

If you want to use an exe method in the current project, you can right-click the Reference of the current project and select Add regerence.
101981-2.png


If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


2.png (19.2 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.