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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T01:39:45+00:00 2026-06-04T01:39:45+00:00

I am writing a wrapper for my native C++ methods in C++/CLI which will

  • 0

I am writing a wrapper for my native C++ methods in C++/CLI which will expose them to C#. Now I am using Visual Studio 2008. Can any one tell me what type of project I need to create so that my wrapper will be exposed to C#. I see in Visual Studio 2008 there are different types of projects under Visual C++—>CLR—->

class library,
CLR Empty Project,
Windows form control library,
CLR Console Application,
Windows Forms Application,
Windows Service

Which one should I use?

  • 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-04T01:39:47+00:00Added an answer on June 4, 2026 at 1:39 am

    You have to create the project of type Class Library. The most important thing is to specify the “Common Language Runtime Support” option (set to “Common Language Runtime Support (/clr)”) in the Project Properties -> Configuration Properties -> General

    This will allow you to use the

    #pragma managed
    ... use your native stuff here
    #pragma unmanaged
    

    pragmas and link with the native .lib files.

    See this link for subtle details

    http://www.codeguru.com/cpp/cpp/cpp_managed/interop/article.php/c6867/Consuming-Unmanaged-C-Class-Libraries-from-NET-Clients.htm

    There is a catch (not mentioned in this article) for 64-bit builds. The “Linker->Input->Force Symbol References” must be set to “_DllMainCRTStartup” for 64-bit and to “_DllMainCRTStartup@12″ for 32-bit.

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

Sidebar

Related Questions

I recently started writing a C++/CLI wrapper for a native c++ library. I'm now
I am writing a .NET wrapper class for an existing native class which throws
I am writing a wrapper around C DLL in C++/CLI so that it can
I'm writing a native wrapper around a managed component written in C++\CLI. I have
I'm writing a wrapper in .NET (C++/CLI) to be able to use some native
Title explains. I have native C++ dlls that I'm writing C++/CLI wrappers for, which
I'm writing a wrapper application that will be used to provide an abstraction layer
I'm writing a wrapper class around a TcpClient which raises an event when data
I'm writing a wrapper layer to be used with mingw which provides the application
I am writing a native COM/Ole/ActiveX wrapper for a scripting language. I need some

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.