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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T19:54:06+00:00 2026-05-20T19:54:06+00:00

I have a mixed mode assembly, built with the /clr option. I am trying

  • 0

I have a mixed mode assembly, built with the /clr option. I am trying to export a class from it, for consumption by another mixed mode assembly, also built with the /clr option.

My problem is that the signature of the method contains a mixture of managed and unmanaged types. For instance:

static System::String ^Convert( const CString from );

Initially, I tried to use __declspec(dllexport) on the non-ref class implementing this. This failed with error C3395: __declspec(dllexport) cannot be applied to a function with the __clrcall calling convention, presumably, because of the managed type in the signature. My next take was to make the class a ref class instead. Now the assembly builds and Reflector displays the exported method like so:

public static unsafe string Convert(CStringT<wchar_t,ATL::StrTraitATL<wchar_t,ATL::ChTraitsCRT<wchar_t> > > modopt(IsConst) modreq(IsCopyConstructed)* from);

However, in the client assembly, I fail to be able to reference the exported method …

CString atlString("test");
AtlCStringConverter::Convert( atlString );

… yields the error C2039: ‘Convert’ : is not a member of ‘XXX::AtlCStringConverter’. I’ve checked for obvious mistakes like mixing different char types that might cause the signature to not be matched.

I realize that neither of these export attempts are really kosher in that a mixture of managed/unmanaged types are exposed side by side in the signature, but since this mixture of managed/unmanaged is fine within a mixed mode assembly, I was wondering if there is no way to export types using this mixture of types in the signature between mixed mode DLLs?

  • 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-20T19:54:06+00:00Added an answer on May 20, 2026 at 7:54 pm

    This question and answer might help:
    Best workaround for compiler error C2158: make_public does not support native template types

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

Sidebar

Related Questions

If I have a 2.0 CLR assembly (pure managed code, no mixed mode issues)
So i have a mixed-mode dll what i would like to load from my
I have to maintain a large C++ mixed-mode application (VC++ 2005, CLR-support: /clr:oldsyntax). I
I have a mixed-mode DLL built in visual studio 2005. In dependency walker, my
I have a mixed mode C++-CLI program in Visual Studio 2005 that is set
I have a python .pyd that is a mixed mode C++ DLL. The DLL
I have a mixed-mode executable and I noticed that the constructor of my native
We use a 3rd party mixed mode assembly that interfaces with a printer device.
I have problem with connecting to Sql Server from my local machine. Seems like
I have a .NET 4.0 class that uses Assembly.LoadFrom to load a .NET 3.5

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.