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. convert c++ to C#

convert c++ to C#

Scheduled Pinned Locked Moved C#
helpquestioncsharpc++tutorial
4 Posts 4 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.
  • E Offline
    E Offline
    eyalso
    wrote on last edited by
    #1

    hi i need to convert the poiners in c++ to C# how can i do it ? for example i have this code in c++ and the main problem is with the *Word i need to use the same funtions (i have dll for the them) but i have problems with the variables or parameters void *StopMemory; int ErrorCode; int LanguageID = 1; int CharCodeID = 1; char *Word = "the"; ErrorCode = ExtrCreateStopMemory(&StopMemory); ErrorCode = ExtrAddStopWord(StopMemory,LanguageID,CharCodeID,(void *) Word); hope somebody will help me thanks eyalso

    J G 2 Replies Last reply
    0
    • E eyalso

      hi i need to convert the poiners in c++ to C# how can i do it ? for example i have this code in c++ and the main problem is with the *Word i need to use the same funtions (i have dll for the them) but i have problems with the variables or parameters void *StopMemory; int ErrorCode; int LanguageID = 1; int CharCodeID = 1; char *Word = "the"; ErrorCode = ExtrCreateStopMemory(&StopMemory); ErrorCode = ExtrAddStopWord(StopMemory,LanguageID,CharCodeID,(void *) Word); hope somebody will help me thanks eyalso

      J Offline
      J Offline
      James Gupta
      wrote on last edited by
      #2

      To use pointers in C# you have to put them within a class defined as "unsafe" through the unsafe keyword.

      S 1 Reply Last reply
      0
      • J James Gupta

        To use pointers in C# you have to put them within a class defined as "unsafe" through the unsafe keyword.

        S Offline
        S Offline
        soma420
        wrote on last edited by
        #3

        the unsafe keyword can also be used inside a function unsafe { //code with unsafe pointers } be sure to use the -unsafe compile option when building!

        1 Reply Last reply
        0
        • E eyalso

          hi i need to convert the poiners in c++ to C# how can i do it ? for example i have this code in c++ and the main problem is with the *Word i need to use the same funtions (i have dll for the them) but i have problems with the variables or parameters void *StopMemory; int ErrorCode; int LanguageID = 1; int CharCodeID = 1; char *Word = "the"; ErrorCode = ExtrCreateStopMemory(&StopMemory); ErrorCode = ExtrAddStopWord(StopMemory,LanguageID,CharCodeID,(void *) Word); hope somebody will help me thanks eyalso

          G Offline
          G Offline
          George L Jackson
          wrote on last edited by
          #4

          Marshal, Marshal, Marshal You can use Managed C++ or C++/CLI to wrap the native code or use P/Invoke from C#.

          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