Results 1 to 3 of 3

Thread: Type Conversion

  1. #1

    Thread Starter
    Fanatic Member x-ice's Avatar
    Join Date
    Mar 2004
    Location
    UK
    Posts
    671

    Resolved Type Conversion

    The type of a picture box handle is IntPtr. Firstly what does 'Ptr' stand for?

    How do i convert this to an int?

    I have tried picCamA.Handle.ToInt32 but the SendMessage API wants an int, not an Int32.
    Last edited by x-ice; Feb 24th, 2007 at 07:13 PM.

  2. #2
    Shared Member
    Join Date
    May 2005
    Location
    Kashmir, India
    Posts
    2,277

    Re: Type Conversion

    I think you should change the declaration of SendMEssage API to use IntPtr rather than int. This is how it should work in .NET
    Use [code] source code here[/code] tags when you post source code.

    My Articles

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

    Re: Type Conversion

    Just as Shuja Ali says. Any API function that wants a handle should have the argument declared as IntPtr. From the help:
    A platform-specific type that is used to represent a pointer or a handle.
    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