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. [DllImport] questen

[DllImport] questen

Scheduled Pinned Locked Moved C#
tutorialquestionlounge
4 Posts 3 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.
  • Q Offline
    Q Offline
    QzRz
    wrote on last edited by
    #1

    Hello I am new to the DLLImport, and I just cant figure out how it works. I have seen in many other applications they use the DLLImport, an example is: [DllImport("KERNEL32.DLL", EntryPoint="MoveFileW", SetLastError=true, CharSet=CharSet.Unicode, ExactSpelling=true, CallingConvention=CallingConvention.StdCall)] public static extern bool MoveFile(String src, String dst); (found it in the MSDN libary) Then my questen is how you know what to write after the [DLLImport ("KERNEL32.DLL", Is there a place to look it up? or are people just guessing what to write? : Just to let you know, it is not the KERNEL32.DLL specific i want to know about, just about the dll's in general. So if anyone know a place where to find this kind of information I would be happy. Thanks QzRz

    O S 2 Replies Last reply
    0
    • Q QzRz

      Hello I am new to the DLLImport, and I just cant figure out how it works. I have seen in many other applications they use the DLLImport, an example is: [DllImport("KERNEL32.DLL", EntryPoint="MoveFileW", SetLastError=true, CharSet=CharSet.Unicode, ExactSpelling=true, CallingConvention=CallingConvention.StdCall)] public static extern bool MoveFile(String src, String dst); (found it in the MSDN libary) Then my questen is how you know what to write after the [DLLImport ("KERNEL32.DLL", Is there a place to look it up? or are people just guessing what to write? : Just to let you know, it is not the KERNEL32.DLL specific i want to know about, just about the dll's in general. So if anyone know a place where to find this kind of information I would be happy. Thanks QzRz

      O Offline
      O Offline
      Office Lineman
      wrote on last edited by
      #2

      P/Invoke[^] -- I've killed again, haven't I?

      1 Reply Last reply
      0
      • Q QzRz

        Hello I am new to the DLLImport, and I just cant figure out how it works. I have seen in many other applications they use the DLLImport, an example is: [DllImport("KERNEL32.DLL", EntryPoint="MoveFileW", SetLastError=true, CharSet=CharSet.Unicode, ExactSpelling=true, CallingConvention=CallingConvention.StdCall)] public static extern bool MoveFile(String src, String dst); (found it in the MSDN libary) Then my questen is how you know what to write after the [DLLImport ("KERNEL32.DLL", Is there a place to look it up? or are people just guessing what to write? : Just to let you know, it is not the KERNEL32.DLL specific i want to know about, just about the dll's in general. So if anyone know a place where to find this kind of information I would be happy. Thanks QzRz

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

        You can go to pinvoke.net but why are you trying to call an unmanaged function (MoveFile) when you can just use File.Move() ?


        Q 1 Reply Last reply
        0
        • S Sean89

          You can go to pinvoke.net but why are you trying to call an unmanaged function (MoveFile) when you can just use File.Move() ?


          Q Offline
          Q Offline
          QzRz
          wrote on last edited by
          #4

          It was just as an example, as it was the only thing I could find, but the pinvoke.net was exactly what I was looking after. Thanks.

          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