Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8205925
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T08:27:57+00:00 2026-06-07T08:27:57+00:00

I have a scenario with three entities: An interface with one method stub A

  • 0

I have a scenario with three entities:

  • An interface with one method stub
  • A class that inherits from `System::Windows::Forms::NativeWindow` and implements the interface
  • A wrapper class that has a private member of the class type and a public property of the interface type. This class also has a `KeyDown` event member that’s to be invoked/raised from the window class

These are the files I’m using:

INativeWindow.h

#pragma  once
public interface class INativeWindow
{
    void Nothing();
};

CLINativeWindow.h

#pragma  once
ref class NWHolder;
public ref class CLINativeWindow : System::Windows::Forms::NativeWindow, INativeWindow
{
public:
    NWHolder^ Parent;
    virtual void  Nothing() sealed;
    void DoIt();
};

CLINativeWindow.cpp

#include "stdafx.h"
#include "CLINativeWindow.h"

void CLINativeWindow::Nothing()
{
    Console::Write("None");
}
void CLINativeWindow::DoIt()
{
    Parent->KeyDown(this, nullptr);
};

NWHolder.h

#pragma  once
#include "INativeWindow.h"
#include "CLINativeWindow.h"

public ref class NWHolder
{

internal:
    event System::Windows::Forms::KeyEventHandler^ KeyDown;
public:
    virtual property INativeWindow^ OwnNativeWindow
    {
        INativeWindow^ __clrcall get() sealed;
        void __clrcall set(INativeWindow^ value) sealed; 
    }

private:
    CLINativeWindow^ nativeWindow_;
};

NWHolder.cpp

#include "stdafx.h"
#include "NWHolder.h"


INativeWindow^ NWHolder::OwnNativeWindow::get()
{
    return nativeWindow_;
}

void NWHolder::OwnNativeWindow::set(INativeWindow^ value)
{
    nativeWindow_ = dynamic_cast<CLINativeWindow^>(value); 
}

At compile time, I get this error:
Error 1 error C3767: 'NWHolder::KeyDown::raise': candidate function(s) not accessible ..\NativeWindows\CLINativeWindow.cpp 10

Is there anything that can be done? I tried even #pragma make_public(System::Windows::Forms::KeyEventHandler) but it failed.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T08:27:58+00:00Added an answer on June 7, 2026 at 8:27 am

    The ‘raise’ inner method of a C++/CLI event is always declared protected. Add a method on NWHolder named “FireKeyDownEvent”, and give it whatever accessibility you like.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Scenario I have a Windows Forms Application. Inside the main form there is a
I have a path defined: when /the admin home\s?page/ /admin/ I have scenario that
I've started using Linq-to-entities with .NET 3.5, and I've come across a scenario that
Here is my scenario: I have my-jsf-app.war (JSF 1.2 application) and daos-and-entities.har (Hibernate 3.3.1)
I have a 'best practice' question for a scenario. Scenario: Multiple entities in a
Say we have this scenario: Artist ==< Album ==< Track //ie, One Artist can
I have an entity model with User and Person entities, such that each User
I have a ASP.NET MVC 3 app with a common scenario where there is
So lets say I have the following scenario. http://website.com:8080 and http://website.com:8080/demo Is there any
I have a simple producer/consumer scenario, where there is only ever a single item

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.