Importing C/C++ function from DLL in a Visual Basic application
Guys,
I'm developing an application in VB which requires importing functions from a C/C++ DLL.
Now, I imported several of the functions structuring them like this:
Declare Auto Function functionName_i Lib "library.dll" Alias functionName(ByVal something, ByRef somethingElse) As ReturnClass
Public Function functionName(ByVal something, ByRef somethingElse) As ReturnClass
Return (functionName_i (something, somethingElse))
End Function
When the functions I import have parameters, either by ref or value, everything works all right.
But when I try to use a function without parameters, like a C++ function with functionName(void) as signature, it does not work, with an exception telling me it was impossible to call the function from the library.
Where is my mistake? How should I import functions without parameters correctly?
Thanks,
hope you can help me!