Is there alternative trick?error: conversion from 'int' to non-scalar type 'wxSQLite3ResultSet' requested
wxSQLite3ResultSet - Cannot return NULL? Topic is solved
- evstevemd
- Part Of The Furniture
- Posts: 2409
- Joined: Wed Jan 28, 2009 11:57 am
- Location: United Republic of Tanzania
wxSQLite3ResultSet - Cannot return NULL?
I have a function that returns wxSQLite3ResultSet . However I want it to return NULL if something goes wrong. I cannot as it throws error:
Chief Justice: We have trouble dear citizens!
Citizens: What it is his honor?
Chief Justice:Our president is an atheist, who will he swear to?
Citizens: What it is his honor?
Chief Justice:Our president is an atheist, who will he swear to?
Re: wxSQLite3ResultSet - Cannot return NULL?
Just return an invalid result set and check it in the calling procedure:evstevemd wrote:I have a function that returns wxSQLite3ResultSet . However I want it to return NULL if something goes wrong. I cannot as it throws error:Is there alternative trick?error: conversion from 'int' to non-scalar type 'wxSQLite3ResultSet' requested
Code: Select all
wxSQLite3ResultSet myFunction()
{
//...
if (error)
return wxSQLite3ResultSet();
}
// code calling the function
wxSQLite3ResultSet myResultSet = myFunction();
if (myResultSet.IsOk())
{
// process result set
}
else
{
// handle error condition
}
Ulrich