Book a Demo

Author Topic: Call by reference to pointer  (Read 4143 times)

molla

  • EA User
  • **
  • Posts: 40
  • Karma: +0/-0
    • View Profile
Call by reference to pointer
« on: March 28, 2002, 03:00:56 pm »
Check the following code, which has a method (testmethod) which returns a  pointer that is created in the implementation (theObject) by reference:

class testclass
{
public:
     testclass();
     virtual ~testclass();

     void testmethod(CObject* &theObject, CString *pName);
}


When reverse-engineered, the method testmethod loses the reference and the parameter name. If you forward-engineer, the method becomes

     void testmethod(CObject* prm1,CString* pName);


I have tried it with other reference parameters such as int& and it seems to work, but the treatment of pointer passing by reference seems to be wrong.

gsparks

  • EA User
  • **
  • Posts: 325
  • Karma: +0/-0
  • I love YaBB 1 Gold!
    • View Profile
Re: Call by reference to pointer
« Reply #1 on: March 28, 2002, 10:39:43 pm »
Hi,

I checked this out and tracked down the problem. It has been fixed and will be available in the next update of EA -due out after Easter. Look for a build number of 479 or higher.

Thanks for taking the time to report the problem,

Geoff Sparks