Passing object reference to funciton

 

Hi, 

Can anyone tell me how I can pass object reference to function? I have tried something like this:

CXmlElement ResponseXml;

void Init() {

(some code) 

 SomeMetod(ResponseXml);

}

void SomeMethod(CXmlElement &xml)

{

(some code)

but I get error that CXmlElement variable is without type.. Anyone knows how to resolve that?

 

Best!

 
mnbvcxz555:

Hi, 

Can anyone tell me how I can pass object reference to function? I have tried something like this:

CXmlElement ResponseXml;

void Init() {

(some code) 

 SomeMetod(ResponseXml);

}

void SomeMethod(CXmlElement &xml)

{

(some code)

but I get error that CXmlElement variable is without type.. Anyone knows how to resolve that?

 

Best!

- include header where CXmlElement is declared

- if & not work, use   SomeMethod(CXmlElement *xml) and use function CheckPointer for xml.

 
Error --> invalid array access --> structure have objects and cannot be copied
Error --> invalid array access --> structure have objects and cannot be copied
  • www.mql5.com
Error --> invalid array access --> structure have objects and cannot be copied.
Reason: