I have to import a few functions of a dll written in C into a VB6 project. I have an example written in C# but I don't really know how to do the same thing in VB6.
In C# it goes like this:
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate int someCallback(IntPtr ch, uint chL, IntPtr cbData);
[DllImport("someDLL.dll", CallingConvention = CallingConvention.Cdecl)]
private static extern int someFunction(IntPtr con, someCallback callback, IntPtr cbData);
Everything works fine in the example when calling someFunction
.
The documentation of the dll just gives me this:
typedef int(SOMEAPI_CALL * someCallback)(const unsigned char *ch,
unsigned int chL,
void *cbData)
SOMEAPI_CALL someFunction(Con* con,
someCallback callback,
void* cbData)
There should be a way to do the same in VB6 but I don't have that much experience with this language. Searched the web for a good time but didn't find anything that could help me.
I know how to declare functions from that dll in my project but thats that. How to convert this UnmanagedFunctionPointer
thingy into VB6 code, I just don't know.