Object browser shows pointer instead of reference

  • Thread starter Thread starter C# Expert
  • Start date Start date
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?
 
You can not export methods with C++ style references. You have to
export pointers.
 
If you want a managed ref parameter, change the declaration to

fun(System::Double& d)

or

fun(double __gc & d)


Mattias
 
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.
 
Back
Top