I am writing a VB6 frontend to my application. The backend is written in
C/C++. I have exposed some classes via a C API to VB. The library has
functions that return pointers to data structures and objects in the
Win32 DLL - nothing unusual there.
However, I am then wrapping up the exposed function in VB6 classes.
Using the plain API (without wrapping the C++ objects in a VB6 class), I
have code that looks like this :
dim lngPtr as long
lngPtr = CreateNewObject() 'calls Dll function
With the exposed C functions wrapped up in VB6 classes, the code looks
something like this:
dim objMyStuff as MyStuff
// which of these statements are correct?
objMyStuff = CreateNewObject() //OR
Set objMyStuff = CreateNewObject()
The VB6 class will hold the pointer as a private variable - and fre the
pointer when the object is going out of scope - in its Terminate()
event. What is not clear to me is how to assign the pointer
automatically from functions that return a pointer.
I dont want to have a user to explicitly set the pointer via a property
or method, I want to be able to assign the pointer via a function call,
so that the (VB) side of the code is simple and will allow a function
returning the pointer to allow the object to start being used ...
comments welcome
Archived from group: microsoft>public>vb>enterprise