CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 1999
    Location
    US, Florida
    Posts
    817

    What is the best way to see what is being returned by API call.......

    Is it string? number? value? boolean? what's the best way?


  2. #2
    Join Date
    Jan 2000
    Location
    MO, USA
    Posts
    1,506

    Re: What is the best way to see what is being returned by API call.......

    usually the API declaration will tell you what's coming back, but if you're not sure, then use the TypeName operator...

    'API Declaration
    Dim vReturnValue 'dont' type the variable - it may impact the typename function later

    vReturnValue = API Function

    MsgBox TypeName(vReturnValue)




    That should tell you the type. I have never had to wonder, so I haven't used this code. But that would be my guess as to how to figure it out. Or you could use things like IsNumeric to see if it's all numbers or not.

    Hope this helps,
    John

    John Pirkey
    MCSD
    www.ShallowWaterSystems.com
    John Pirkey
    MCSD (VB6)
    http://www.stlvbug.org

  3. #3
    Join Date
    Apr 1999
    Location
    Rotterdam, Netherlands
    Posts
    278

    Re: What is the best way to see what is being returned by API call.......

    Most API's return a long, which works either as boolean (non-zero or zero, succes or failed). Sometimes it returns when non-zero the number of characters, sometimes it's a handle. But almost always a long...
    Since you need to declare your api calls, you should be able to see what it returns.. and if everything else fails, msdn.m$.com is kinda slow, but says it all....

    Crazy D :-)
    "One ring rules them all"

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

Featured