I am writing a wrapper for a C# .dll to be used by a c++ program. I have the functions working but I am not sure how to access/set-up the properties in the wrapper so they are accessible.
The properties are of all different data types, some are read only, some are protected writes, and some are read write.
I trimmed down my code some to show how I have things set up. But I can't figure out how to do the properties and have had no luck googling it. Maybe looking for the wrong term?
My code: c#:
public class RFIDInterface
{
public bool TagDetected
{
get;
private set;
}
public Byte[] TagData
{
get;
set;
}
public RFIDInterface()
{
...
}
public bool Connect()
{
...
}
}
.H file:
class RFIDWrapperIFacePrivate;
class __declspec(dllexport) RFIDWrapperIFace
{
private:
RFIDWrapperIFacePrivate* _private;
public:
// Constructors
RFIDWrapperIFace();
// destructors
~RFIDWrapperIFace();
// Connection functions
bool Connect();
// properties
???????
};
.C file:
class RFIDWrapperIFacePrivate
{
public:
msclr::auto_gcroot<RF182CInterface::RFIDInterface^> rf182CInterface;
};
// default constructor
RFIDWrapperIFace::RFIDWrapperIFace()
{
_private = new RFIDWrapperIFacePrivate();
_private->rf182CInterface = gcnew RF182CInterface::RFIDInterface();
}
// deconstructor
RFIDWrapperIFace::~RFIDWrapperIFace()
{
delete _private;
}
// Connects to the RF182C device
// returns: True if successful
bool RFIDWrapperIFace::Connect()
{
return _private->rf182CInterface->Connect();
}
// Transmits a string to the RF182C device
// Message: the message to transmit
// returns: True if successful
bool RFIDWrapperIFace::TransmitMessage(const char* Message)
{
return _private->rf182CInterface->TransmitMessage(gcnew System::String(Message));
}
// properties
?????