I have this class:
#pragma once
#ifndef _DEFINES_H_
#include "Defines.h"
#endif
#ifndef _GAMETIME_H_
#include "GameTime.h"
#endif
#ifndef _UTILITIES_H_
#include "Utilities.h"
#endif
#ifndef _GAME_H_
using namespace System;
namespace BSGameFramework
{
public ref class Game
{
    public:
        Game();
        virtual ~Game();
        void Run(HINSTANCE instance);
        string Title;
        int WindowWidth;
        int WindowHeight;
    protected:
        virtual void Initialize();
        virtual void LoadContent();
        virtual void UnloadContent();
        virtual void Update(GameTime^ gameTime);
        virtual void Draw(GameTime^ gameTime);
    private:
        HINSTANCE windowHandler;
        HWND window;
        DateTime lastTime;
        TimeSpan totalGameTime;
        D3D_DRIVER_TYPE driverType_;
        D3D_FEATURE_LEVEL featureLevel_;
        ID3D11Device* d3dDevice_;
        ID3D11DeviceContext* d3dContext_;
        IDXGISwapChain* swapChain_;
        ID3D11RenderTargetView* backBufferTarget_;
        void Shutdown();
};
}
#define _GAME_H_
#endif
and this is its child:
#pragma once
using namespace BSGameFramework;
public ref class MyGame : Game
{
public:
    MyGame()
    {
    }
};
Then when on my Main I call my Run function:
#include <Windows.h>
#include "MyGame.h"
using namespace BSGameFramework;
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
{
MyGame ^game = gcnew MyGame();
game->Run(hInstance); // Here the error
}
I get this error:
Error   1   error C3767: 'BSGameFramework::Game::Run': candidate function(s) not accessible
C:\Users\Nicola\Desktop\directx prove\BSGameFramework\FrameworkTestCpp\Main.cpp 10  1   FrameworkTestCpp
I've tried to remove the HINSTANCE from Run parameters and all is working fine, but I need it so somebody can explain me why I'm getting this error and how can I solve? Thanks in advance!
                        
I have solved in this way:
now I'm passing an IntPtr that is not a native type, so on main function I have this: