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 7443049
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T11:16:15+00:00 2026-05-29T11:16:15+00:00

I have an Assembly(A) which defines a Managed class which has a public constructor

  • 0

I have an Assembly(A) which defines a Managed class which has a public constructor that takes two native types.

I have access to the Header files and compiled lib files which contain the native types.

I created a C++/CLI project and defined a ref class which contains a single public: static method that returns a public type defined in (A).

When I try to contstruct by passing in a native type I receive the `C3767 ‘YourType::TypeB’: Candidate function(s) not accessible.

I’ve added #pragma make_public(Type) for the native types and any type they derive from but still not joy.

My class header:

#pragma once
#include "StdAfx.h"

using namespace System;
using namespace AssemblyA;

namespace NativeWrapper {
    ref class MyFactory
    {
    public:
        static AssemblyAType^ Build();
    };
}

My cpp file:

#include "StdAfx.h"

#pragma make_public(nativeObjectRoot)
#pragma make_public(nativeObjectDerived)


#include "MyFactory.h"

using namespace System;

using namespace NativeWrapper;

AssemblyAType^ MyFactory::Build()
{
  nativeObjectDerived* myNativeObject;
  //myNativeObject initialised and set up here
  return gcnew AssemblyAType(myNativeObject); <--C3767
}

I’ve looked and the managed type `AssemblyAType’ has a public constructor with this signature. Can’t seem to get the pragma to work??

So to summarize.

My C++/CLI project references a 3rd party Assembly that defines a type which takes a native type in its constructor. My project also has the header/lib files added/linked to.

Note: my code above isn’t exactly what I’ve got but I’ve stripped out the pertinent parts.

  • 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-05-29T11:16:16+00:00Added an answer on May 29, 2026 at 11:16 am

    make_public will make the the native type visibile to consumers of the assembly where you use it: http://msdn.microsoft.com/en-us/library/ms235607(v=vs.80).aspx. It will not change the visibility in an assembly you reference.

    It seems the assembly you referenced should have had either a make_public for the native type, or simply declared the native type public (see Type visibilty for a header Share a header file shared between native and managed clients).

    The below page seems to indicate that they should have gotten a warning for writing the method without making the native types public: http://msdn.microsoft.com/en-us/library/ms173713(v=vs.80).aspx

    Perhaps you could post the third-party AssemblyAType code to make sure there’s nothing else we’re missing.

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

Sidebar

Related Questions

I have an assembly which I have managed to make visible to VB6 and
I have a helper assembly which includes a function to identify object types: namespace
I have a simple managed C++ assembly which I am providing unmanaged wrappers for
I have created a class library (assembly) that provides messaging, email and sms. This
I have a .NET assembly which has defined a type T at compile time,
I have an assembly which should not be used by any application other than
I have an assembly which wraps the functionality of an external live web service.
I have an assembly which I need to GAC on a SharePoint machine I
If I have an assembly (A) which references another assembly (B). I want to
Having an assembly which I cannot modify (vendor-supplied) which have a method returning an

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.