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?
You can use OS native DLLs from your Java project using Java Native Interface (JNI):
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.
Just to be clear, the core of this question is: how do I get C++ DLL to talk to a VB DLL?
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#.