Hello,
Is there a syntax used in C++/CLI to access protected C++ methods from a C# application?
What I have currently in my MFC header file:
class CMFCApplication1Doc : public CDocument
{
protected: // create from serialization only
CMFCApplication1Doc() noexcept;
DECLARE_DYNCREATE(CMFCApplication1Doc)
// Attributes
public:
// Operations
public:
int OnTest();
// Overrides
public:
virtual BOOL OnNewDocument();
virtual void Serialize(CArchive& ar);
// Implementation
public:
virtual ~CMFCApplication1Doc();
protected:
int TestFunction();
};
And in my Wrapper.cpp
int CSharpMFCWrapper::CSharpMFCWrapperClass::Test()
{
pCC->TestFunction();
return 0;
}
Accessing public functions pose no problems. Just the protected ones.
The Test() is declared in my Wrapper.h file and the pCC pointer is pointing to the protected C++ method.
I'm trying to not alter the underlying C++ code I am referencing hence the question.