Results 1 to 4 of 4

Thread: [RESOLVED] com interop

  1. #1

    Thread Starter
    Fanatic Member popskie's Avatar
    Join Date
    Jul 2005
    Location
    In my chair
    Posts
    666

    Resolved [RESOLVED] com interop

    hi,

    how to convert kernell32.dll to .net framework. I heared this this process called com interop. It is posible to view all function inside this dll?


    thanks,

    Popskie

  2. #2
    PowerPoster sunburnt's Avatar
    Join Date
    Feb 2001
    Location
    Boulder, Colorado
    Posts
    1,403

    Re: com interop

    Since Kernel32 is not a COM library, you cannot use COM interop to call its functions. However, you can use Platform Invoke.

    For example, to reference the MoveFile function from Kernel32:

    Code:
    public class wrapper
    {
       [DllImport("Kernel32.dll")]
       public static extern int MoveFile(string moveFrom, string moveTo);
    };
    
    // and then...
    wrapper.MoveFile(@"C:\test.txt", @"C:\test_moved.txt");
    HTH.
    Every passing hour brings the Solar System forty-three thousand miles closer to Globular Cluster M13 in Hercules -- and still there are some misfits who insist that there is no such thing as progress.

  3. #3

    Thread Starter
    Fanatic Member popskie's Avatar
    Join Date
    Jul 2005
    Location
    In my chair
    Posts
    666

    Re: com interop

    thanks sunburnt but how to get all function inside the dll. e.g. the movefile function. Is there any third party software?

    thanks,

    Popskie

  4. #4

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width