Object browser shows pointer instead of reference

C

C# Expert

I am using managed c++ code.
I have created i function with one argument that is reference to
double.
fun(double& d)
When I see it in object browser in visual studio 2005, it shows pointer
instead of reference.
fun(double* d)

I reference that .dll from my project which is written in c#,.

If i write in my c# code
double x;
fun(ref x);
it gives compile time error.

but If i write
double* x;
fun(x);
It works fine.

Why reference is converted to pointer?
 
N

Nicholas Paldino [.NET/C# MVP]

You can not export methods with C++ style references. You have to
export pointers.
 
M

Mattias Sjögren

If you want a managed ref parameter, change the declaration to

fun(System::Double& d)

or

fun(double __gc & d)


Mattias
 
C

C# User

If I write
fun(double __gc & d) it works fine. After that It takes reference
This problem is sloved by using __gc

But now Object browser doesn't show this function.
Please send your idea in this.
 

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