A
asnowfall
I am calling a function with a reference parameter. Inside the function
(GetXMLRecord)
I am changing the input parameter. When the function returns, input
parameter is not reflecting the change. This would have worked in C++,
but not here
What I am doing wrong? Pls help.
ref class ImageFileData
{
public NameValueCollection^ m_pNameValueCollection;
public:
ImageFileData()
{
m_pNameValueCollection = gcnew NameValueCollection;
}
int GetXMLRecord( NameValueCollection^ data)
{
if(m_pNameValueCollection->Count)
{
data = m_pNameValueCollection; ///VALUE set here to "data" does
not get
///here will not carried to caller
}
return 0;
}
}
public ref class Test : public System::Windows::Forms::Form
{
ImageFileData^ m_pImageFileData;
}
void Test :: initControlsFromXML( )
{
NameValueCollection^ objCustomData ;
m_pImageFileData->GetXMLRecord( objCustomData); //////VALUE set
inside function does
//not hold good when the function returns
}
(GetXMLRecord)
I am changing the input parameter. When the function returns, input
parameter is not reflecting the change. This would have worked in C++,
but not here
What I am doing wrong? Pls help.
ref class ImageFileData
{
public NameValueCollection^ m_pNameValueCollection;
public:
ImageFileData()
{
m_pNameValueCollection = gcnew NameValueCollection;
}
int GetXMLRecord( NameValueCollection^ data)
{
if(m_pNameValueCollection->Count)
{
data = m_pNameValueCollection; ///VALUE set here to "data" does
not get
///here will not carried to caller
}
return 0;
}
}
public ref class Test : public System::Windows::Forms::Form
{
ImageFileData^ m_pImageFileData;
}
void Test :: initControlsFromXML( )
{
NameValueCollection^ objCustomData ;
m_pImageFileData->GetXMLRecord( objCustomData); //////VALUE set
inside function does
//not hold good when the function returns
}