I'm writing again since nobody has answered my previous post about the strange error I get under win98/ME and 2000 (debug assertion failure at daocore.cpp @ line 453, but the code actually works perfect under winxp sp2.
Can this function call fail in some configuration of Windows NT 4.0 and later? The docs state that the complementary SetSystemTime call will fail if the user doesn't have the privileges to set the time on a system. I have an application that is failing to return this information. The function is void, so the only real valid check is to check the SYSTEMTIME struct for empty values.
What I need my application to do is allow the user to type in their username, password and Domain and then using the Net API validate the password with the username and then see if the user is a member of a certain group (A group which I have set up).
Could anyone help me on this subject (Really struggling).
Any sample code (Using C++ MFC/win32) or guide lines would be very much appreciated.
(CLASendMailApp* )AfxGetApp() casts that pointer to a pointer to a CLASendMailApp. that way, any functions called through that pointer will act on your CLASendMailApp application, and not on the CWinApp base class.
why ? CWinApp doesn't have a LoadSettings() member function. CLASendMailApp (hopefully) does.
Tom Wright wrote: I need to access a function that is in another class that I have I can "cast" it like this?
you can only safely cast a pointer like this if the To and From class are realted to each other (ie. if the To class is derived from the From class, or vice versa).
Tom Wright wrote: And in my first example can I cast a pointer to me class in the void OnClose function?
you can't cast a class pointer to something that isn't a class. if you need pointers to your class in a function that isn't a member of your class, you'll need to pass a pointer to an object of your class into that function (or maybe make it available as a global variable):
I'm trying to setup a Timer in my UI thread. While doing this I found that the easiest way was to do the SetTimer with the forth parameter being the callback function.
Problem is that I've never really worked with callback function and while working with this particular one I found that i did not have access to m_pconnection pointer and the thdID pointer.
I remembered that someone had helped me with another program that did a casting of a pointer like the one listed at the beginning of the post, but i wasn't sure if this is what I needed to do here and since i didn't really understand what was happening with that line of code I decided to post.
So comming full circle I'm still trying to understand when one needs to cast a pointer and when one needs to pass a pointer.
Heck I just found out how to initialize a char array on the fly (so to speak) using the new operator. I've always seen it used but never understood why until it was explained to me.
Last Visit: 1-Dec-20 1:24 Last Update: 1-Dec-20 1:24