I have a simple ATL object which contains a function that looks like this:
Object1::Function(Object2 * obj2, long * retval)
{
obj2->Property = 5;
*retval = 1;
}
From my front-end code, I call it like this:
...
{
ATLLib::Object1Ptr * obj1;
ATLLib::Object2Ptr * obj2;
long prop, retval;
retval = obj1->Function(obj2);
prop = obj2->Property;
}
Now, when the function gets called from the front end, the retval makes it out OK, but the property from Obj2 does not. The only explanation for this is that a copy of Object2 is being passed in, not its pointer. This is despite the fact that a pointer is clearly defined as an argument to the function. There's some kind of funky indirection thing that ATL does that I don't understand -- like also not having to pass a reference to retval even though the function itself takes it as a parameter.
What's going on here? How do I get the value of that property back out of the ATL function?
Start Free Trial