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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T20:33:20+00:00 2026-06-18T20:33:20+00:00

I have recently acquired the C++ source code of a 3D game engine I

  • 0

I have recently acquired the C++ source code of a 3D game engine I plan to use. However my C++ coding skills are far from legendary, and I definitely find C# easier to work with. I have seen components that are implemented fully in C++ and have only a set of wrapper classes in .NET, that have no source code – instead they point directly to the DLL’s classes using the [ComImport] keyword to mark classes as external, and the `public virtual extern’ keyword to mark functions as external. Is it possible therefore to use SWIG, create classes and methods in C# that link directly to the classes and methods in the DLL of the C++ game engine? So I should be able to instanciate the classes of the C++ engine directly in .NET, and control them from .NET. Is this possible?

  • 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-18T20:33:21+00:00Added an answer on June 18, 2026 at 8:33 pm

    You can only use [ComImport] if you C++ classes are COM objects. There is a strong possibility that they are not given this is a Game Engine. (Search your C++ code for COM methods like CoInitialize to know for sure)

    Given you have the source, theoretically SWIG will create C# wrappers for your C++ , without needing you C++ classes to be COM objects, However don’t expect this to be entirely trivial.

    An alternative approach I’ve taken in the past is to write a ‘C’ wrapper for my C++ (google ‘extern “c”‘) and then its easy to create C# wrappers, using pinvoke. Whether this is possible in you’ve case will depend on the C++ api.

    Bear in mind that any C# => native (c, c++ etc) will involve some performance penalty. How much will depend on how frequent the C# -> native (or native -> C#) calls are made.

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

Sidebar

Related Questions

I have recently been looking for a tool to generate Java code from a
I recently acquired this book from Microsoft Press. I currently have Office Enterprise 2007
I have recently had a linux server compromised from bots uploading .php scripts and
I have recently made changes in some code that makes a char name field
I have recently acquired a ViewSonic G Tablet running Android 2.2 for the development
I have recently downloaded ghci, however when i try to compile my .hs file
Recently I have been refactoring some of my C# code and I found a
I have recently been going through some of our windows python 2.4 code and
I have recently migrated from Windows to Linux (Debian, 64-bit) and am trying to
I have recently switched from using Ubuntu system Ruby to using RVM. When I

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.