Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: DllCall Visual Basic DLL
Does someone know how to format the dll/functions or call them so that it works?
Use the QUIKVIEW.EXE program to see what the exported functions (& their ordinal values) are.
Make sure that your DllCall() function call uses the EXACT name of the function as exported in the DLL (which is not necessarily the same as the function name in your source code).
Other than that, be very careful about passing mechanisms used to pass parameter values into the functions that are being called. Stick to passing by value instead of by reference. Passing by reference implies that your functions in the DLL are able to modify the value being passed in. The only way to support this with WinBatch is to use binary buffers and the 'lpbinary' data type in the DllCall() function call.
Simple data types can be returned by the function that is called. Complex record structures should be avoided.
If possible, re-write your DLL to be an OLE server and create methods that can be used to accept data and return results. When you are in full control of the code that you are writing you can make things much easier on yourself. WinBatch can work very nicely as an OLE client that can activate and talk to an OLE server. Of course, there are more setup activities involved in registering an OLE server on your system.
I don't create my DLL's with VB but it should have a similar mechanism. I'm not sure that just defining the functions as public causes them to be exported.
There is also some kind of "Export" you have to do. Not sure. Check VB Newsgroups? http://www.deja.com ?? Search VB help files for Export.
Article ID: W14220
Filename: VB Dll Usage with DllCall.txt
File Created: 1999:10:26:11:22:28
Last Updated: 1999:10:26:11:22:28