
Passing by reference through ATL?
Learning ATL:
I have a ATL method that I need to pass back a string. So I would like to
do it by reference.
HRESULT xx::getString( BSTR sValue, long nValue )
{
if( nValue == 0 )
{
sValue = "Return 0 for false";
S_FALSE;
}
else
{
sValue = "Return as true";
return S_OK;
}
Quote:
}
I know how I'm handling and returning string back to VB wrong as the code
shown above.
In VB i would do the following:
Dim sValue as String
...
...
Call oTest.getString( sValue, 1 )
MsgBox "This is the solutin: " & sValue
If someone can help me in the ATL C++ section on how to handle return by
reference.
Thanks