error return should be last parameter (out parameters should be after in parameters).