0
我有一個C#接口,看起來像這樣:C++/CLI實現一個C#接口
public interface ITdcConnector
{
void Close(uint);
void FetchRequestAsync(ManagedFetchRequest);
UInt32 Open(String, Action<uint, ManagedFetchResponse>, out Int64);
}
我想用C實現++/CLI是這樣的:
public ref class MockTdcConnector : public ITdcConnector
{
public:
virtual Void Close(UInt32);
Void FetchRequestAsync(ManagedFetchRequest);
UInt32 Open(String, Action<UInt32, ManagedFetchResponse^>^,
[System::Runtime::InteropServices::Out] Int64%);
};
智能感知是給我在Open()
方法上的悲傷。它告訴我:IntelliSense: class fails to implement interface member function "ITdcConnector::Open"
我已經看過在C++/CLI中實現C#類的few relevant examples,但沒有運氣。有關如何讓C++/cli方法簽名看起來像C#方法的想法?
@HansPassant謝謝您的回答,但我得到了它,下面。 –