Results 1 to 3 of 3

Thread: What is the difference between these two declarations?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2006
    Posts
    121

    What is the difference between these two declarations?

    Code:
    [DllImport("user32.dll")]
    public static extern int FindWindow(string lpClassName, string lpWindowName);

    Code:
    [DllImport("user32", EntryPoint = "FindWindowA")]
    private static extern IntPtr FindWindow(
    [MarshalAs(UnmanagedType.LPStr)] string lpClassName, 
    [MarshalAs(UnmanagedType.LPStr)] string lpWindowName);

  2. #2

    Thread Starter
    Lively Member
    Join Date
    Jan 2006
    Posts
    121

    Re: What is the difference between these two declarations?

    The first one I understand.

    The second one im not sure what these items mean
    1. EntryPoint =
    2. IntPtr
    3. MarshalAs(UnmanagedType.LPStr)

    can someone explain those three items and how they are different from the first one?

  3. #3
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: What is the difference between these two declarations?

    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

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