Click to See Complete Forum and Search --> : What is the best way to see what is being returned by API call.......


AndyK
February 18th, 2000, 04:43 PM
Is it string? number? value? boolean? what's the best way?

Johnny101
February 18th, 2000, 04:50 PM
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

Crazy D
February 19th, 2000, 04:55 AM
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"