私はマネージクラスから使用したいアンマネージドライブラリを持っています。機能のインタフェースは次のとおりです。C++/CLI managed VS.アンマネージドショート
GetProgress(short* value);
だから、私はマネージクラスに書いた:
short val = 0;
GetProgress(&val);
私は次のエラーました:私はthis topicを読んで、私は私を変え
Error C2664: 'GetProgress' : cannot convert parameter 1 from 'cli::interior_ptr' in 'short *' with [ Type=short ]
をコード:
short val = 0;
pin_ptr<short*> pVal = &val;
GetProgress(pVal);
さらに前のエラーに加えて
Error C2440: 'initialisation' : cannot convert from 'short *' to 'cli::pin_ptr' with [ Type=short * ]
どうすればこの問題を解決できますか?
それだけです。ありがとう! :) – gregseth