K
KevinSimonson
I'm in a situation where I need to call a non-static function every
fifteen minutes. I read the article at "http://www.codeproject.com/KB/
cpp/SetTimer__non-static.aspx?display=Print", that told me how to use
"SetTimer()" with callback to a non-static member function, and used
the author's basic idea, though I didn't write a callback wrapper
function. His idea was basically to create a static variable of type
"void *" in the class, and before my code calls "SetTimer()", it sets
that "void *" object to "this". I've got the "void *" object declared
as public in my header file. Then the author said to put a line that
says "void* CHomeSearchCtrl::chsObject;" in my implementation to match
the header file, which I did. Then in my callback function I cast
"chsObject" back to type "CHomeSearchCtrl" and store it in variable
"hsc", and then I call "hsc->Search( true, true);" ("Search()" is the
non-static function that needs to be called every fifteen minutes.
Then I try to compile this code, and I get the message,
"1>c:\program files\microsoft visual studio 10.0\vc\include
\fstream(890): error
C2248:'std::basic_ios<_Elem,_Traits> ::basic_ios' : cannot access
private member declared in class 'std::basic_ios<_Elem,_Traits>'".
Isn't this kind of bizarre? I mean, it's not complaining about my
code, is it? Instead it's complaining about
"vc\include\fstream"! How can changes I make to my local code be
causing compilation errors in "vc\include\fstream", that I have
absolutely no control over?
Anyhow, I'm kind of lost. Is someone could point out to me how I can
get my project compiled I'd really appreciate it. My operating system
is Windows XP and I'm compiling on Visual Studio (version
10.0.30319.1).
Kevin S
fifteen minutes. I read the article at "http://www.codeproject.com/KB/
cpp/SetTimer__non-static.aspx?display=Print", that told me how to use
"SetTimer()" with callback to a non-static member function, and used
the author's basic idea, though I didn't write a callback wrapper
function. His idea was basically to create a static variable of type
"void *" in the class, and before my code calls "SetTimer()", it sets
that "void *" object to "this". I've got the "void *" object declared
as public in my header file. Then the author said to put a line that
says "void* CHomeSearchCtrl::chsObject;" in my implementation to match
the header file, which I did. Then in my callback function I cast
"chsObject" back to type "CHomeSearchCtrl" and store it in variable
"hsc", and then I call "hsc->Search( true, true);" ("Search()" is the
non-static function that needs to be called every fifteen minutes.
Then I try to compile this code, and I get the message,
"1>c:\program files\microsoft visual studio 10.0\vc\include
\fstream(890): error
C2248:'std::basic_ios<_Elem,_Traits> ::basic_ios' : cannot access
private member declared in class 'std::basic_ios<_Elem,_Traits>'".
Isn't this kind of bizarre? I mean, it's not complaining about my
code, is it? Instead it's complaining about
"vc\include\fstream"! How can changes I make to my local code be
causing compilation errors in "vc\include\fstream", that I have
absolutely no control over?
Anyhow, I'm kind of lost. Is someone could point out to me how I can
get my project compiled I'd really appreciate it. My operating system
is Windows XP and I'm compiling on Visual Studio (version
10.0.30319.1).
Kevin S