Reputation: 255
I need to reference a C++ dll from my Java project. The method that I need to expose is actually written in Visual Basic. Is there any way to access the Visual Basic code in C++, so that it can eventually be accessed in the Java project?
Upvotes: 2
Views: 847
Reputation: 124
jmac posted the original question on my behalf. I needed to find a way to call VB DLL function from a C++ DLL.
I've given up on the VB DLL and opted for a C# DLL. The following link provides a downloadable Visual Studio solution that provides a project called DLLExporter that exports C# functions thus making them available to C++. The VS solution was written in a version earlier than 2010 but the VS 2010 migrator had no problem importing it.
http://www.codeproject.com/KB/dotnet/DllExporter.aspx
It solved my problem.
For the record, I tried to wrap my VB DLL inside the C# DLL but it didn't work. So I just migrated my VB code to C#.
Upvotes: 1
Reputation: 3061
as per Andriy Sholokh ,u need to use JNI to communicate with c or c++ from your java project. You have to use native method inside your java code. hope it will help you.
Upvotes: 0
Reputation: 51498
Assuming this is VB 6.0 and not VB.NET, you need to create an MFC DLL wrapper for your VB ActiveX DLL.
Here's more information on Exporting VB DLL Functions.
Upvotes: 1
Reputation: 872
You can use OS native DLLs from your Java project using Java Native Interface (JNI):
Upvotes: 2