Convert IntPtr to Handle

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • erupakat@emirates.net.ae

    #1

    Convert IntPtr to Handle

    Hello,
    I am using VS2005 along with a third part SDK . In that I am having a
    function called OpenInterface() which will return a Handle .I think in
    VS2005 they replaced Handle with IntPtr. How can I solve this issue. I
    require this handle in all functions provided by SDK.
    Thanks

  • Herfried K. Wagner [MVP]

    #2
    Re: Convert IntPtr to Handle

    <erupakat@emira tes.net.aeschri eb:
    I am using VS2005 along with a third part SDK . In that I am having a
    function called OpenInterface() which will return a Handle .I think in
    VS2005 they replaced Handle with IntPtr. How can I solve this issue. I
    require this handle in all functions provided by SDK.
    What's the exact function prototype and type name?

    --
    M S Herfried K. Wagner
    M V P <URL:http://dotnet.mvps.org/>
    V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

    Comment

    • Stuart Nathan

      #3
      Re: Convert IntPtr to Handle

      You can try changing the definition from IntPtr to Integer. It works for
      many APIs


      Comment

      • erupakat@emirates.net.ae

        #4
        Re: Convert IntPtr to Handle

        Hello,

        The function is like
        Handle OpenInterface() ;

        Herfried K. Wagner [MVP] wrote:
        <erupakat@emira tes.net.aeschri eb:
        I am using VS2005 along with a third part SDK . In that I am having a
        function called OpenInterface() which will return a Handle .I think in
        VS2005 they replaced Handle with IntPtr. How can I solve this issue. I
        require this handle in all functions provided by SDK.
        >
        What's the exact function prototype and type name?
        >
        --
        M S Herfried K. Wagner
        M V P <URL:http://dotnet.mvps.org/>
        V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

        Comment

        • erupakat@emirates.net.ae

          #5
          Re: Convert IntPtr to Handle

          I want to change from IntPtr to Handle type.
          The function I am using has the prototype
          Handle OpenInterface()

          Stuart Nathan wrote:
          You can try changing the definition from IntPtr to Integer. It works for
          many APIs

          Comment

          • Herfried K. Wagner [MVP]

            #6
            Re: Convert IntPtr to Handle

            <erupakat@emira tes.net.aeschri eb:
            The function is like
            Handle OpenInterface() ;
            The problem is we do not know anything about the 'Handle' type the function
            is using. Do you have the 'typedef' for the type?

            --
            M S Herfried K. Wagner
            M V P <URL:http://dotnet.mvps.org/>
            V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

            Comment

            • Stuart Nathan

              #7
              Re: Convert IntPtr to Handle

              You can try h = Handle.ToInt32


              Comment

              Working...