Dealing with pointers calling into a C++ DLL from Visual Basic (VB6)
Posted on 2003-11-03
I have a C++ DLL formatted correctly to allow me to call into it from VB. The functions are declared in the module etc fine but the problem I am having is dealing with the pointers C++ uses.
One example with void* which is meant to be casted into a specific user defined type in C++.
void* deStateIn (int *size)
How can I handle this in VB? If I had a void* as a paramter how would I pass something into it from VB?
How do I deal with a pointer to a user defined object being returned?
How do I deal with a char* being returned?
char* deStateSite (int x, int y)
How do I deal with a method that takes a pointer to a unsigned char that is really a buffer for a string? (expecting something simliar to unsigned char ipaddr = "000.000.000.000")
int diuInit (int max_slots, unsigned char*dest_ip, int udp_port)
Any help would be greatly appreciated. I have been trying to solve these issues for awhile and am not having any luck. Thanks in advance.