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#
  4. How to access unmanaged function in c#

How to access unmanaged function in c#

Scheduled Pinned Locked Moved C#
csharpc++helptutorial
8 Posts 6 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.
  • K Offline
    K Offline
    Killer3
    wrote on last edited by
    #1

    Requirement : VC++ dll ==> Exports a class which contains few functions. I need to create a C# Application that consumes the function in VC++ dll. Looking forward ur Help for thendral

    N A 2 Replies Last reply
    0
    • K Killer3

      Requirement : VC++ dll ==> Exports a class which contains few functions. I need to create a C# Application that consumes the function in VC++ dll. Looking forward ur Help for thendral

      N Offline
      N Offline
      NassosReyzidis
      wrote on last edited by
      #2

      Hi there use : using System.Runtime.InteropServices; and in the class (propably a static helper class) [DllImport ("user32.dll")] public static extern long DestroyWindow (long hWnd); and from your program call : MyStaticHelper.DestroyWindow (this.Handle); Hope that helped Nassos GanDad

      1 Reply Last reply
      0
      • K Killer3

        Requirement : VC++ dll ==> Exports a class which contains few functions. I need to create a C# Application that consumes the function in VC++ dll. Looking forward ur Help for thendral

        A Offline
        A Offline
        AB7771
        wrote on last edited by
        #3

        Add the dll into ur project, add a reference to that dll, Create an object of the class in the dll, and call the methods of that class. Regards, Pramod

        L 1 Reply Last reply
        0
        • A AB7771

          Add the dll into ur project, add a reference to that dll, Create an object of the class in the dll, and call the methods of that class. Regards, Pramod

          L Offline
          L Offline
          leppie
          wrote on last edited by
          #4

          I suggest you read the question more carefully next before you give wrong advise.

          xacc.ide-0.1.3.2

          A 1 Reply Last reply
          0
          • L leppie

            I suggest you read the question more carefully next before you give wrong advise.

            xacc.ide-0.1.3.2

            A Offline
            A Offline
            AB7771
            wrote on last edited by
            #5

            But that is how i have used a dll created in VC++. I knew that method, so i adviced. May be that is wrong for him, but no one perfect here, This is an open forum and everyone is here to help each other, whatever they can. it's not necessary that the answer has to be the perfect one There are many ways to do one single thing. Hope u get it. If you can't give solutions u r not supposed to say wrong to anyone. Got it!!! Pramod

            J 1 Reply Last reply
            0
            • A AB7771

              But that is how i have used a dll created in VC++. I knew that method, so i adviced. May be that is wrong for him, but no one perfect here, This is an open forum and everyone is here to help each other, whatever they can. it's not necessary that the answer has to be the perfect one There are many ways to do one single thing. Hope u get it. If you can't give solutions u r not supposed to say wrong to anyone. Got it!!! Pramod

              J Offline
              J Offline
              J4amieC
              wrote on last edited by
              #6

              Your methods will work for COM dll's only. VS just writes a COM Wrapper for you.

              Richard Andrew x64R 1 Reply Last reply
              0
              • J J4amieC

                Your methods will work for COM dll's only. VS just writes a COM Wrapper for you.

                Richard Andrew x64R Offline
                Richard Andrew x64R Offline
                Richard Andrew x64
                wrote on last edited by
                #7

                That is certainly true, but his point was that he's not supposed to be afraid to post a reply to someone's question just cause his answer might not be 100% correct. This is not medical advice being given here. There is no law being broken if someone gives mistaken advice. This is a community forum where people are encouraged to contribute. There is no rule that tells people that their contributions are not welcome unless they are perfect.

                J 1 Reply Last reply
                0
                • Richard Andrew x64R Richard Andrew x64

                  That is certainly true, but his point was that he's not supposed to be afraid to post a reply to someone's question just cause his answer might not be 100% correct. This is not medical advice being given here. There is no law being broken if someone gives mistaken advice. This is a community forum where people are encouraged to contribute. There is no rule that tells people that their contributions are not welcome unless they are perfect.

                  J Offline
                  J Offline
                  J4amieC
                  wrote on last edited by
                  #8

                  I agree wholeheartidly, I responded because he seemed surprised that his answer was taken as incorrect without explaination as to the problem! Notice i didnt chastise him for responding with what he thought was a good answer - that was somebody else!

                  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