Managed C++ : How to call static class members?

  • Thread starter Thread starter Marauderz
  • Start date Start date
M

Marauderz

Hi there...

VC++ newbie here.. I'm wondering how do I call the Static Members of classes
defined by a DLL.

For example supposed I have a function defined as :-

static neSimulator * CreateSimulator(const neSimulatorSizeInfo & sizeInfo,
neAllocatorAbstract * alloc = NULL,
const neV3 * gravity = NULL);

I'm guessing in Managed C++ I should call it as

neSimulator* gSim;
gSim=neSimulator::CreateSimulator(sizeInfo,NULL,&gravity);

But on the call, I get a NullReference exception. And I have no idea what
I'm not doing properly, can anyone help.

ps. For those who know.. yup.. I'm trying to wrap the Tokamak Physics
Library... has anyone already done it? :P
 
OK.. I think I've figured out what's wrong. It seems like I can't call the
function from ANOTHER managed project say VB.Net or another managed C++
project.

If I put the same code in a managed console project the code runs flawlessly
over all the unmanaged sections. Therefore I must be doing something wrong
that doesn't allow me to reference my class library project and use it as an
intemdiary to call the unmanaged functions via the IJW method.

Can anyone tell me what I'm doing wrongly?
 
Back
Top