Jump to content
Excelsior Forums
Hguo.

Not even the simplest VB dll?

Recommended Posts

Why is it that I can't call even the simplest function in my VB dll?

In my java-program

xFunction helloFunction = new xFunction("VBTestDll", "void SaySomething()");

helloFunction.invoke();

In my VB-program (VBTestDll)

Public Sub SaySomething()

 MsgBox "Something."

End Sub

This is what I get:

com.excelsior.xFunction.FunctionNotFoundException: Can't load function: 'SaySomething'.

Dying for an answer...

 Thanks

   /Spepp

Share this post


Link to post
Share on other sites

1. Instead of the function name, you have to specify the name of the DLL entry point for that function, which can be e.g. "_SaySomething@0". To determine the entry point name, do a Quick View on that DLL from Windows Explorer and scroll down to the Export Table section.

2. You have to ensure that your exported function has stdcall calling convention.

3. In general, making direct VB<->Java calls is not recommended due to conflicts between their runtime environments. You should use a Java to COM/ActiveX bridge instead. Do a search for Jacob or Bridge2Java on your favorite Internet search engine.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×