I have an unmanaged library which I want to use from a managed class. The interface of the function is:
GetProgress(short* value);
So I wrote in my managed class:
short val = 0;
GetProgress(&val);
I got the following error:
Error C2664: 'GetProgress' : cannot convert parameter 1 from 'cli::interior_ptr' in 'short *' with [ Type=short ]
I read this topic, so I changed my code into:
short val = 0;
pin_ptr<short*> pVal = &val;
GetProgress(pVal);
And in addition to the previous error I get
Error C2440: 'initialisation' : cannot convert from 'short *' to 'cli::pin_ptr' with [ Type=short * ]
How can I fix this?