Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. C# to C++ inter operating

C# to C++ inter operating

Scheduled Pinned Locked Moved C / C++ / MFC
csharptutorialquestionc++com
2 Posts 2 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    SameepSheth123654
    wrote on last edited by
    #1

    Hello, I am attempting this example http://www.codeproject.com/managedcpp/ijw_unmanaged.asp[^] I am newbie so let me clear myself what i understood and where I got stuck. This solution contains three project 1) C # Class Library 2) C++ Managed Library 3) C++ Unmanged Console Application Am I correct? If so Q. after Building 1) and 2) I get two .dlls. In this example's case they are ManagedClasses.dll and ManagedWrapper.dll. HOWEVER to build 3) I need four items, the above two .dll files, IManagedWrapper.h file AND ManagedWrapper.lib file. CAN SOMEONE PLEASE TELL ME HOW TO MAKE .lib file out of 2) ? Q. another question i have is about how to make this projects? I mean When I create a C # library project in .NET 2005 it won't let me include System.Windows.Forms. The included Project sample with the link above somehow gets around it. Can someone explain me how? Also How is 2) (C++ Managed Library ) created? in .Net? when I tried making one.. I ended up with six default files. :( Do i just delete them? Thx a lot Sameep

    D 1 Reply Last reply
    0
    • S SameepSheth123654

      Hello, I am attempting this example http://www.codeproject.com/managedcpp/ijw_unmanaged.asp[^] I am newbie so let me clear myself what i understood and where I got stuck. This solution contains three project 1) C # Class Library 2) C++ Managed Library 3) C++ Unmanged Console Application Am I correct? If so Q. after Building 1) and 2) I get two .dlls. In this example's case they are ManagedClasses.dll and ManagedWrapper.dll. HOWEVER to build 3) I need four items, the above two .dll files, IManagedWrapper.h file AND ManagedWrapper.lib file. CAN SOMEONE PLEASE TELL ME HOW TO MAKE .lib file out of 2) ? Q. another question i have is about how to make this projects? I mean When I create a C # library project in .NET 2005 it won't let me include System.Windows.Forms. The included Project sample with the link above somehow gets around it. Can someone explain me how? Also How is 2) (C++ Managed Library ) created? in .Net? when I tried making one.. I ended up with six default files. :( Do i just delete them? Thx a lot Sameep

      D Offline
      D Offline
      DavidR_r
      wrote on last edited by
      #2

      First, you should understand rhe idea: you are tring to run unmanaged code in the manged framework. Thus, the MangedWrapper is an adaptor between the codes which by one side obeys the rules of the managed framework but is capable wrap the unmanaged code and make it managed too. So, the managed apllication calls the wrapper which calls the unmanaged code. In other words the managed code should "know" the Wrapper and the Wrapper should know the "unmanaged" and not the other direction. When you want to extend the managed appliction and to intorduce new classes you should insert the refference to the assembly (or dll in other words)in the project of the mannged application. On the other hnd the wrapper includes the h file of the unmanaged class. 2) When you create a new project choose Visula C++ project category and then Managed C++ class I hope this helps you

      DavidR

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups