Slimelite BBS

pointers to member functions

Back to EMULATE

From Darin McBride · 1996-04-10 03:30 · #73598 in EMULATE

In reply to pointers to member functions by Marcel Schepers

 MS> void FAR PASCAL _export bs(float y[], int nv, void 
 MS> (*derivs)(float,         float *, float *));

This looks fine... ;-)

 MS> virtual void TBlackHoleWindow::Derives(float Sigma, 
 MS> float X[], float dXdS[]);

Let's do a quick conversion to C from this, as the old C++ compilers had to do when creating C code for a real compiler (since C++ was more of a translated language originally) to compile.

void Derives(TBlackHoleWindow* this, float Sigma, float X[], float dXdS[]);

Hmmm, this isn't what your bs function above wants... this has four parameters (one of which is hidden in C++) whereas your bs function wants the address of a function requiring only four parameters.

If it weren't 'virtual', I would suggest a static function instead.  Either way, your DLL cannot call 'object.Derive' because you don't give it the 'object' (in C, simply a struct, really) to operate on.



--- Maximus/2 3.01
 * Origin: Tanktalus' Tower BBS (PVT) (1:342/708)