Witam tak jak w temacie mam problem odnośnie powyższej biblioteki. Biblioteke dodałem poprzez References->Add new References i wybrałem plik WiimoteLib.dll. Następnie postępowałem zgodnie z przykładami z C# tj analogicznie jak tam starałem się stworzyć
#pragma once
namespace formatka {
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
using namespace WiimoteLib;
/// <summary>
/// Summary for Form1
/// </summary>
public ref class Form1 : public System::Windows::Forms::Form
{
public:
Form1(void)
{
InitializeComponent();
//
//TODO: Add the constructor code here
//
}
protected:
/// <summary>
/// Clean up any resources being used.
/// </summary>
~Form1()
{
if (components)
{
delete components;
}
}
private:
/// <summary>
/// Required designer variable.
/// </summary>
System::ComponentModel::Container ^components;
** Wiimote wm = gcnew Wiimote(); //error C3845: 'formatka::Form1::wm': only static data members can be initialized inside a ref class or value type**
#pragma region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
void InitializeComponent(void)
{
this->SuspendLayout();
//
// Form1
//
this->AutoScaleDimensions = System::Drawing::SizeF(13, 13);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->ClientSize = System::Drawing::Size(284, 262);
this->Name = L"Form1";
this->Text = L"Form1";
this->Load += gcnew System::EventHandler(this, &Form1::Form1_Load);
this->ResumeLayout(false);
}
#pragma endregion
private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {
**Wiimote wm = gcnew Wiimote(); //error C3767: 'WiimoteLib::Wiimote::Wiimote': candidate function(s) not accessible**
}
};
}
Gwiazdkami zaznaczyłem miejsca w których występowanie tego co chce daje mi takie błędy czytałem że problem z dostępnością wiąże się niby z tym że funkcje nie są publiczne czy coś. Jestem dość bardzo początkującym programistą dlatego prosiłbym o w miarę jasne odpowiedzi.
Strona do lekkiego tutoriala http://channel9.msdn.com/coding4fun/articles/Managed-Library-for-Nintendos-Wiimote