Calling conventions during fit

I am using Root 3.05.04 on WinXP and VC++6.0 SP5

What calling conventions are used when compiling a ROOT dll. I got a problem inside my chisquare function which calls a function in the main (MFC) app. The second parameter is always put as value onto the stack and not as reference as mentioned in the function definition. The called function assumes a reference ang gets totally confused. Any help from ROOT forum possible?

Could you give more details?
which ROOT function are you calling?
An example is more than welcome

Rene

The ROOT Dll is a fitting routine using minuit. It is constructed using Andrew Haas site as guide.
In the chisquare routine I have the line

	fpFitObj->ToWorldFit (wcPos, wcAct, phik);

fpFitObj is an object of class CChip defined as follows

class CChip : public FitObj// : public CObject
{
public:
[snip]
virtual void ToWorldFit (WorldCoord& wcPos, const WorldCoord& wcAct, const double dPhi); //< virtual from class FitObj. Transform chip coords in world coords.
[snip]
CChip();
virtual ~CChip();

int m_iNumCoord;

protected:
WorldCoord m_wcChipOff; //< Relative position of rotation points in chip coordinates.
WorldCoord m_wcCam2Pos; //< Position of rotation center over camera 2 in world coords.
MotorCoord m_mcFirst; //< result of first call to GetCoord ()
MotorCoord m_mcMeasPos; //<
WorldCoord m_wcOffset; //<
list m_clCoord;
list m_clRef;
POINT m_pPtsFrame[5]; //< list of border frame points.
[snip]
};

virtual void ToWorldFit (WorldCoord& wcPos, const WorldCoord& wcAct, const double dPhi); 

is the declaration I would like to use. But only using

virtual void ToWorldFit (WorldCoord& wcPos, const WorldCoord wcAct, const double dPhi); 

works. Why is the & ignored and the WorldCoord put as value onto the stack?

A sample app with source code is attached. Any more info needed?
fittest.zip (91.7 KB)