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. problem integrating unmanaged C/C++ with C#

problem integrating unmanaged C/C++ with C#

Scheduled Pinned Locked Moved C#
csharpdotnethelpquestionc++
3 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.
  • P Offline
    P Offline
    pelos
    wrote on last edited by
    #1

    hi forum, I want to integrate an old C application with a C# library (dll). I know there are various alternatives but i have choosen the "managed C++ extensions" way. What i do is to modify the compiler options by adding the /clr option and to recompile the old C application... but the compilation returns this error: Command line error D2016 : '/YXstdafx.h' and '/clr' command-line options are incompatible do u know what is the problem and its solution? I am using Visual Studio .NET 2002 (.NET Framework 1.0) Thanks in advance! Sergio.

    P 1 Reply Last reply
    0
    • P pelos

      hi forum, I want to integrate an old C application with a C# library (dll). I know there are various alternatives but i have choosen the "managed C++ extensions" way. What i do is to modify the compiler options by adding the /clr option and to recompile the old C application... but the compilation returns this error: Command line error D2016 : '/YXstdafx.h' and '/clr' command-line options are incompatible do u know what is the problem and its solution? I am using Visual Studio .NET 2002 (.NET Framework 1.0) Thanks in advance! Sergio.

      P Offline
      P Offline
      pelos
      wrote on last edited by
      #2

      hi, I have solved the problem by setting the "Not Using Precompiled Headers" option, but now i have got another problem: I dont know how to use the imported C# dll. What i do is to copy the c# dll in the "debug" folder. Then, I set the path of the "debug" folder in the "resolve #using reference" project property and finally, I import in the C++ program the C# dll by using the #using directive: #usign "MyDLL.dll" But now, how can I create an object contained in the DLL? Thanks a lot!! Sergio.

      D 1 Reply Last reply
      0
      • P pelos

        hi, I have solved the problem by setting the "Not Using Precompiled Headers" option, but now i have got another problem: I dont know how to use the imported C# dll. What i do is to copy the c# dll in the "debug" folder. Then, I set the path of the "debug" folder in the "resolve #using reference" project property and finally, I import in the C++ program the C# dll by using the #using directive: #usign "MyDLL.dll" But now, how can I create an object contained in the DLL? Thanks a lot!! Sergio.

        D Offline
        D Offline
        Dave Kreskowiak
        wrote on last edited by
        #3

        Your question belongs in the C++ Forum, not C#. If your trying to use the C# .DLL in Mnaged C++, it's a question for the Managed C++ Forum. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

        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