Pass pointer from c# to C++ wrapper

M

mo

I have a C++.net wrapper class to a C++ library... A function takes in
a pointer in the wrapper... How do I pass that in C#??? Any help would
be appreciated, Thank you.

// functions in original c++ library
prCAPI PR_StartSDK( prVoid );
prCAPI PR_FinishSDK( prVoid );
prCAPI PR_GetDeviceList( prUInt32* pBufferSize, prDeviceList*
pDeviceList );

// functions in c++.net wrapper
int _PR_StartSDK()
{
return PR_StartSDK();
}

int _PR_FinishSDK()
{
return PR_FinishSDK();
}

int _PR_GetDeviceList( prUInt32 *pBufferSize, prDeviceList* pDeviceList
)
{
return PR_GetDeviceList( pBufferSize, pDeviceList );
}


// function calls in c#
int a = c._PR_StartSDK(); // WORKS
int b = c._PR_FinishSDK(); // WORKS

uint e;
prDeviceList f;
int d = c._PR_GetDeviceList( e, f );

// errors returned when building
- The best overloaded method match for
'tester.Class1._PR_GetDeviceList(uint*, prDeviceList*)' has some
invalid arguments

- Argument '1': cannot convert from 'uint' to 'uint*'

- Argument '2': cannot convert from 'prDeviceList' to 'prDeviceList*'
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top