Napisałem taką bibliotekę w C++/CLI:
public ref class PJSIPLib
{
// TODO: Add your methods for this class here.
// TODO: Add your methods for this class here.
public:
// Returns a + b
static double Add(double a, double b);
static String^ GetVersion();
ref class PJStatusT
{
private:
Int32^ pjValue;
public :
property Int32^ Value
{
Int32^ get();
void set(Int32^ value);
}
};
static PJStatusT^ CreatePJsua();
};
I metody:
double PJSIPLib::Add(double a, double b)
{
return a + b;
}
System::String^ PJSIPLib::GetVersion() {
return "3.0.0.0";
};
Int32^ PJSIPLib::PJStatusT::Value::get()
{
return pjValue;
}
void PJSIPLib::PJStatusT::Value::set(Int32^ value)
{
pjValue=value;
};
PJSIPLib::PJStatusT^ PJSIPLib::CreatePJsua()
{
PJSIPLib::PJStatusT^ status = gcnew PJSIPLib::PJStatusT();
//status. intellisense nic nie wypisuje po kropce
return 0;
};
Dlaczego metoda CreatePJsua() nie jest widoczna na zewnątrz biblioteki?
Klasa zagnieżdżona nie może mieć modyfikatora public bo od razu kompilator się burzy.
Dodam, że klasa Add i GetVersion działają jak należy. Co robię źle? Jak sobie z tym poradzić?