07-18-2016, 08:30 PM
(This post was last modified: 07-19-2016, 07:35 AM by Rick Johnson.)
Call me Nemo, but sometimes I'm often sure I can do things and later find that I can't. I'm trying to add an InternetGET to my preferences class, to alert the user if there's an update available.
My prefs class contains this, plus the callback functions:
I must have tried fifty variations to create the InternetGET without success, noting that empty InternetGET objects cannot be constructed. Xcode continually scolds me about this class having a private default constructor. Once it's properly created, I understand that I should call its run() function to do the PHP query, then the callback will call the content() function to get the query result. If I find it sometimes takes a while, I'd like to make it asynchronous. Actually, asynchronous sounds like a better approach, regardless.
What is the proper syntax for this? This isn't quite as straightforward as making a dialog's button go to a URL.
Many thanks -- Rick
Edit: I later tried creating it in my main Plugin class as a test. Still stumped. I'll work through any namespace issues of my own making later, but it would be much easier if I first knew the correct syntax to get started.
My prefs class contains this, plus the callback functions:
Code:
hdi::core::InternetGET iGET(hid::core::InternetGET("http://HodorUsesCORE.org/version.php?p=126",HDI_CORE_CALLBACK(sansa::thePrefs, this, verifyVersionOKCB), HDI_CORE_CALLBACK(sansa::thePrefs, this, verifyVersionFailCB)); // my prefs class resides within a namespace
I must have tried fifty variations to create the InternetGET without success, noting that empty InternetGET objects cannot be constructed. Xcode continually scolds me about this class having a private default constructor. Once it's properly created, I understand that I should call its run() function to do the PHP query, then the callback will call the content() function to get the query result. If I find it sometimes takes a while, I'd like to make it asynchronous. Actually, asynchronous sounds like a better approach, regardless.
What is the proper syntax for this? This isn't quite as straightforward as making a dialog's button go to a URL.
Many thanks -- Rick
Edit: I later tried creating it in my main Plugin class as a test. Still stumped. I'll work through any namespace issues of my own making later, but it would be much easier if I first knew the correct syntax to get started.