Return type of COM Methods

Hi all, Any one have idea of HResult return type. This is the COM IAxapta methods return type. Do you have idea how to catch these return types in VB. I am new in com application integration , as well as very less knowledge in VB. Any example/piece of code will be very helpful to me. Thanks Aks

HResult corresponds to the Long data type in VB. You can simply assign HResult values to variables of type Long.

Hi Aks, You should be able to handle return value of HRESULT using the standard error handling method in VB. Like - ---------------------------------------------------- Private sub tstMethod_Click() On Error GoTo ErrorHandler Dim objInt as Integer … Exit sub ErrorHandler: MsgBox "Error : " & Err.Description, vbCritical, _ & str$(Err.Number) End sub ---------------------------------------------------- Basically, HRESULT is a 32-bit structure using which most C/C++ functions would return value. It is this that value would determine whether functions were successful or not. In some cases, values HRESULT may typically use an S_prefix for success codes and an E_prefix for failure. When you invoke a function written in C/C++ from VB, VB runtime will recognize a returning HRESULT and process it automatically. In other words, VB would hide its existence to make code more manageable. Hope this helps, Harish Mohanbabu