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
  1. Home
  2. General Programming
  3. C#
  4. a c++ class library/dll in your c# project

a c++ class library/dll in your c# project

Scheduled Pinned Locked Moved C#
c++csharpvisual-studiocomsecurity
4 Posts 2 Posters 0 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.
  • N Offline
    N Offline
    Natural_Demon
    wrote on last edited by
    #1

    hi, i would like to have some help with the following. i made a c++ class library and added this to my c# project. i would like to store some data in this class and retrieve this data when needed. this class compiles and i can find it in the c# bin folder of my project. i have done a litle reading on the subject, but it's not very clear to me. http://support.microsoft.com/kb/828736[^] http://msdn.microsoft.com/en-us/library/ms235591.aspx[^] as non universitary professional coder. i have made some MFC experience in the visual studio 2003 era, but .... : ) but i stil would like to know how it's done. can any show me how it's done? i have the following files in the c++ project. Header Files - authentication.h - resource.h - Stdafx.h Source Files - AssemblyInfo.cpp - authentication.cpp - Stdafx.cpp containing of the authentication.C file

    // This is the main DLL file.

    #include "stdafx.h"

    #include "authentication.h"

    please show how to store/set from c# a value in that c++ dll and retrieve it back to c#. kind regards and thank you for your time

    Bad = knowing 2 much

    L 1 Reply Last reply
    0
    • N Natural_Demon

      hi, i would like to have some help with the following. i made a c++ class library and added this to my c# project. i would like to store some data in this class and retrieve this data when needed. this class compiles and i can find it in the c# bin folder of my project. i have done a litle reading on the subject, but it's not very clear to me. http://support.microsoft.com/kb/828736[^] http://msdn.microsoft.com/en-us/library/ms235591.aspx[^] as non universitary professional coder. i have made some MFC experience in the visual studio 2003 era, but .... : ) but i stil would like to know how it's done. can any show me how it's done? i have the following files in the c++ project. Header Files - authentication.h - resource.h - Stdafx.h Source Files - AssemblyInfo.cpp - authentication.cpp - Stdafx.cpp containing of the authentication.C file

      // This is the main DLL file.

      #include "stdafx.h"

      #include "authentication.h"

      please show how to store/set from c# a value in that c++ dll and retrieve it back to c#. kind regards and thank you for your time

      Bad = knowing 2 much

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Is your c++ library COM or native library? See the samples here for calling native libary from .NET and here using COM objects into managed code. :)

      Life is a stage and we are all actors!

      N 1 Reply Last reply
      0
      • L Lost User

        Is your c++ library COM or native library? See the samples here for calling native libary from .NET and here using COM objects into managed code. :)

        Life is a stage and we are all actors!

        N Offline
        N Offline
        Natural_Demon
        wrote on last edited by
        #3

        i don't know, that'as why i ask. i simply added a basic (not ATL, MFC or whatever) c++ class library project to my c# project.

        Bad = knowing 2 much

        L 1 Reply Last reply
        0
        • N Natural_Demon

          i don't know, that'as why i ask. i simply added a basic (not ATL, MFC or whatever) c++ class library project to my c# project.

          Bad = knowing 2 much

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          I suppose your library is native.Follow this link for quick and easy sample how to consume C/C++ code in C#. :)

          Life is a stage and we are all actors!

          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